File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -139,13 +139,15 @@ func gitInit(t *testing.T, path string) {
139139
140140func gitInitRepos (t * testing.T , names ... string ) string {
141141 root := t .TempDir ()
142- root = filepath .Join (root , "repos-root" )
143142
144- err := os .Mkdir (root , 0755 )
145- if err != nil {
146- t .Fatal (err )
143+ // We cannot set root on a non-existent dir so we return tmpdir
144+ // creating repos-root first causes issues with test clean-up on Windows.
145+ if len (names ) == 0 {
146+ return root
147147 }
148148
149+ root = filepath .Join (root , "repos-root" )
150+
149151 for _ , name := range names {
150152 p := filepath .Join (root , name )
151153 if err := os .MkdirAll (p , 0755 ); err != nil {
@@ -175,6 +177,7 @@ func TestIgnoreGitSubmodules(t *testing.T) {
175177
176178 rootFS , err := os .OpenRoot (root )
177179 if err != nil {
180+
178181 t .Fatal (err )
179182 }
180183
You can’t perform that action at this time.
0 commit comments