Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Refactoring CreateTestRepository #130

Merged

Conversation

marcelometal
Copy link
Member

Now each git command is a function

}
content := ""
return ioutil.WriteFile(path.Join(testPath, file), []byte(content), 0644)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this -- and other concatenations below -- could be simplified:

func CreateEmptyFile(tmpPath, repo, file string) error {
    testPath := path.Join(tmpPath, repo+".git")
    if file == "" {
        file = fmt.Sprintf("README_%d", time.Now().UnixNano())
    }
    content := ""
    return ioutil.WriteFile(path.Join(testPath, file), []byte(content), 0644)
}

Now each git command is a function
andrewsmedina added a commit that referenced this pull request Jul 25, 2014
@andrewsmedina andrewsmedina merged commit d8c4ae6 into tsuru:master Jul 25, 2014
@andrewsmedina
Copy link
Contributor

@marcelometal thank you!

@marcelometal marcelometal deleted the refactoring_create_repository branch July 25, 2014 20:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants