diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-05-04 01:48:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-04 01:48:53 +0200 |
commit | e727d4d0cf4beff77c44bb143a5edb560c840aab (patch) | |
tree | f43a94ef85be1f3a36c5dfb1bb60eb0747c15902 /plumbing/format/index/index.go | |
parent | 727bf94da8e3cebd3ff467d30425b12d671fbca7 (diff) | |
parent | 75c5adffb8b1e80665753784129e2f16210514c1 (diff) | |
download | go-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.go | 6 |
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` |