We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bcaede8 commit 1da0bacCopy full SHA for 1da0bac
storage/filesystem/dotgit/dotgit.go
@@ -33,8 +33,9 @@ const (
33
34
tmpPackedRefsPrefix = "._packed-refs"
35
36
- packExt = ".pack"
37
- idxExt = ".idx"
+ packPrefix = "pack-"
+ packExt = ".pack"
38
+ idxExt = ".idx"
39
)
40
41
var (
@@ -224,11 +225,11 @@ func (d *DotGit) objectPacks() ([]plumbing.Hash, error) {
224
225
226
var packs []plumbing.Hash
227
for _, f := range files {
- if !strings.HasSuffix(f.Name(), packExt) {
228
+ n := f.Name()
229
+ if !strings.HasPrefix(n, packPrefix) || !strings.HasSuffix(n, packExt) {
230
continue
231
}
232
- n := f.Name()
233
h := plumbing.NewHash(n[5 : len(n)-5]) //pack-(hash).pack
234
if h.IsZero() {
235
// Ignore files with badly-formatted names.
0 commit comments