File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -207,9 +207,16 @@ func checkDir() error {
207
207
if err != nil {
208
208
return err
209
209
}
210
- if info .Name () != "go.mod" && ! strings .HasPrefix (info .Name (), "." ) {
210
+ // Allow the whole .git directory tree
211
+ if info .IsDir () && strings .HasPrefix (info .Name (), "." ) && info .Name () != "." {
212
+ return filepath .SkipDir
213
+ }
214
+ // Also allow go.mod and dot-files
215
+ if info .Name () != "go.mod" && info .Name () != "go.sum" && ! strings .HasPrefix (info .Name (), "." ) {
211
216
return fmt .Errorf (
212
- "target directory is not empty (only go.mod and files with the prefix \" .\" are allowed); found existing file %q" ,
217
+ "target directory is not empty " +
218
+ "(only go.mod, go.sum, and files and directories with the prefix \" .\" are allowed); " +
219
+ "found existing file %q" ,
213
220
path )
214
221
}
215
222
return nil
You can’t perform that action at this time.
0 commit comments