@@ -62,21 +62,12 @@ func addAuthorInfo(cmd *exec.Cmd, timestamp *time.Time) {
6262}
6363
6464func newGitBomb (
65- t * testing.T , repoName string , depth , breadth int , body string ,
65+ t * testing.T , path string , depth , breadth int , body string ,
6666) (repo * git.Repository ) {
6767 t .Helper ()
6868
69- path , err := ioutil .TempDir ("" , repoName )
70- require .NoError (t , err )
71-
72- defer func () {
73- if err != nil {
74- os .RemoveAll (path )
75- }
76- }()
77-
7869 cmd := exec .Command ("git" , "init" , "--bare" , path )
79- err = cmd .Run ()
70+ err : = cmd .Run ()
8071 require .NoError (t , err )
8172
8273 repo , err = git .NewRepository (path )
@@ -144,8 +135,14 @@ func TestBomb(t *testing.T) {
144135 t .Parallel ()
145136 assert := assert .New (t )
146137
147- repo := newGitBomb (t , "bomb" , 10 , 10 , "boom!\n " )
148- defer os .RemoveAll (repo .Path ())
138+ path , err := ioutil .TempDir ("" , "bomb" )
139+ require .NoError (t , err )
140+
141+ defer func () {
142+ os .RemoveAll (path )
143+ }()
144+
145+ repo := newGitBomb (t , path , 10 , 10 , "boom!\n " )
149146
150147 h , err := sizes .ScanRepositoryUsingGraph (
151148 repo , git .AllReferencesFilter , sizes .NameStyleFull , false ,
0 commit comments