Skip to content

Commit cb8298b

Browse files
earl-warrenGusted
andauthored
Ignore temporary files for directory size (#28265)
Co-authored-by: Gusted <[email protected]>
1 parent 05b8023 commit cb8298b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/repository/create.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@ func getDirectorySize(path string) (int64, error) {
167167
}
168168
return err
169169
}
170-
if info.IsDir() {
170+
171+
fileName := info.Name()
172+
// Ignore temporary Git files as they will like be missing once info.Info is
173+
// called and cause a disrupt to the whole operation.
174+
if info.IsDir() || strings.HasSuffix(fileName, ".lock") || strings.HasPrefix(filepath.Base(fileName), "tmp_graph") {
171175
return nil
172176
}
173177
f, err := info.Info()

0 commit comments

Comments
 (0)