diff options
author | Michael Muré <batolettre@gmail.com> | 2018-09-30 11:10:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-30 11:10:03 +0200 |
commit | d71bb7dd7632780cf5aad5fda84027fa03a9d0f0 (patch) | |
tree | dba6c3c0bab18f41e21cd36a9fe05d1d27a574d4 /tests/read_bugs_test.go | |
parent | 8fdd6bf99c111c3756056e87ffd9209875ac5c1f (diff) | |
parent | bad9cda969b49bf1bce6799056476ac4684892df (diff) | |
download | git-bug-d71bb7dd7632780cf5aad5fda84027fa03a9d0f0.tar.gz |
Merge pull request #54 from MichaelMure/editablecomment
Core support for editable comments
Diffstat (limited to 'tests/read_bugs_test.go')
-rw-r--r-- | tests/read_bugs_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/read_bugs_test.go b/tests/read_bugs_test.go index c3c7d9ea..b28da49b 100644 --- a/tests/read_bugs_test.go +++ b/tests/read_bugs_test.go @@ -1,6 +1,8 @@ package tests import ( + "io/ioutil" + "log" "testing" "github.com/MichaelMure/git-bug/bug" @@ -8,6 +10,30 @@ import ( "github.com/MichaelMure/git-bug/repository" ) +func createRepo(bare bool) *repository.GitRepo { + dir, err := ioutil.TempDir("", "") + if err != nil { + log.Fatal(err) + } + + // fmt.Println("Creating repo:", dir) + + var creator func(string) (*repository.GitRepo, error) + + if bare { + creator = repository.InitBareGitRepo + } else { + creator = repository.InitGitRepo + } + + repo, err := creator(dir) + if err != nil { + log.Fatal(err) + } + + return repo +} + func createFilledRepo(bugNumber int) repository.ClockedRepo { repo := createRepo(false) |