Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pack/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var (
// filepath that is a packfile.
//
// It includes one matchgroup, which is the SHA-1 name of the pack.
nameRe = regexp.MustCompile(`^pack-([a-f0-9]{40}).pack$`)
nameRe = regexp.MustCompile(`^(.*)\.pack$`)
)

// NewSet creates a new *Set of all packfiles found in a given object database's
Expand All @@ -40,7 +40,7 @@ var (
func NewSet(db string) (*Set, error) {
pd := filepath.Join(db, "pack")

paths, err := filepath.Glob(filepath.Join(pd, "pack-*.pack"))
paths, err := filepath.Glob(filepath.Join(pd, "*.pack"))
if err != nil {
return nil, err
}
Expand All @@ -55,7 +55,7 @@ func NewSet(db string) (*Set, error) {

name := submatch[1]

idxf, err := os.Open(filepath.Join(pd, fmt.Sprintf("pack-%s.idx", name)))
idxf, err := os.Open(filepath.Join(pd, fmt.Sprintf("%s.idx", name)))
if err != nil {
// We have a pack (since it matched the regex), but the
// index is missing or unusable. Skip this pack and
Expand All @@ -69,7 +69,7 @@ func NewSet(db string) (*Set, error) {
continue
}

packf, err := os.Open(filepath.Join(pd, fmt.Sprintf("pack-%s.pack", name)))
packf, err := os.Open(filepath.Join(pd, fmt.Sprintf("%s.pack", name)))
if err != nil {
return nil, err
}
Expand Down