@@ -62,21 +62,12 @@ func addAuthorInfo(cmd *exec.Cmd, timestamp *time.Time) {
62
62
}
63
63
64
64
func newGitBomb (
65
- t * testing.T , repoName string , depth , breadth int , body string ,
65
+ t * testing.T , path string , depth , breadth int , body string ,
66
66
) (repo * git.Repository ) {
67
67
t .Helper ()
68
68
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
-
78
69
cmd := exec .Command ("git" , "init" , "--bare" , path )
79
- err = cmd .Run ()
70
+ err : = cmd .Run ()
80
71
require .NoError (t , err )
81
72
82
73
repo , err = git .NewRepository (path )
@@ -144,8 +135,14 @@ func TestBomb(t *testing.T) {
144
135
t .Parallel ()
145
136
assert := assert .New (t )
146
137
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 " )
149
146
150
147
h , err := sizes .ScanRepositoryUsingGraph (
151
148
repo , git .AllReferencesFilter , sizes .NameStyleFull , false ,
0 commit comments