2727 // filepath that is a packfile.
2828 //
2929 // It includes one matchgroup, which is the SHA-1 name of the pack.
30- nameRe = regexp .MustCompile (`^pack-([a-f0-9]{40}) .pack$` )
30+ nameRe = regexp .MustCompile (`^(.*)\ .pack$` )
3131)
3232
3333// NewSet creates a new *Set of all packfiles found in a given object database's
4040func NewSet (db string ) (* Set , error ) {
4141 pd := filepath .Join (db , "pack" )
4242
43- paths , err := filepath .Glob (filepath .Join (pd , "pack- *.pack" ))
43+ paths , err := filepath .Glob (filepath .Join (pd , "*.pack" ))
4444 if err != nil {
4545 return nil , err
4646 }
@@ -55,7 +55,7 @@ func NewSet(db string) (*Set, error) {
5555
5656 name := submatch [1 ]
5757
58- idxf , err := os .Open (filepath .Join (pd , fmt .Sprintf ("pack- %s.idx" , name )))
58+ idxf , err := os .Open (filepath .Join (pd , fmt .Sprintf ("%s.idx" , name )))
5959 if err != nil {
6060 // We have a pack (since it matched the regex), but the
6161 // index is missing or unusable. Skip this pack and
@@ -69,7 +69,7 @@ func NewSet(db string) (*Set, error) {
6969 continue
7070 }
7171
72- packf , err := os .Open (filepath .Join (pd , fmt .Sprintf ("pack- %s.pack" , name )))
72+ packf , err := os .Open (filepath .Join (pd , fmt .Sprintf ("%s.pack" , name )))
7373 if err != nil {
7474 return nil , err
7575 }
0 commit comments