aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/index/index.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-05-04 01:48:53 +0200
committerGitHub <noreply@github.com>2017-05-04 01:48:53 +0200
commite727d4d0cf4beff77c44bb143a5edb560c840aab (patch)
treef43a94ef85be1f3a36c5dfb1bb60eb0747c15902 /plumbing/format/index/index.go
parent727bf94da8e3cebd3ff467d30425b12d671fbca7 (diff)
parent75c5adffb8b1e80665753784129e2f16210514c1 (diff)
downloadgo-git-e727d4d0cf4beff77c44bb143a5edb560c840aab.tar.gz
Merge pull request #364 from mcuadros/index-pointer
plumbing: index, Entries converted in a slice of pointers
Diffstat (limited to 'plumbing/format/index/index.go')
-rw-r--r--plumbing/format/index/index.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/plumbing/format/index/index.go b/plumbing/format/index/index.go
index 402a48e..782e3d1 100644
--- a/plumbing/format/index/index.go
+++ b/plumbing/format/index/index.go
@@ -44,7 +44,7 @@ type Index struct {
Version uint32
// Entries collection of entries represented by this Index. The order of
// this collection is not guaranteed
- Entries []Entry
+ Entries []*Entry
// Cache represents the 'Cached tree' extension
Cache *Tree
// ResolveUndo represents the 'Resolve undo' extension
@@ -52,14 +52,14 @@ type Index struct {
}
// Entry returns the entry that match the given path, if any.
-func (i *Index) Entry(path string) (Entry, error) {
+func (i *Index) Entry(path string) (*Entry, error) {
for _, e := range i.Entries {
if e.Name == path {
return e, nil
}
}
- return Entry{}, ErrEntryNotFound
+ return nil, ErrEntryNotFound
}
// String is equivalent to `git ls-files --stage --debug`