aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/index/index.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-04-26 20:48:13 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2017-04-26 20:48:13 +0200
commit9b75cb91384dd08eed2acce8c3099e082835da12 (patch)
treef559053ac65bd67e29412f586e71fc2969cd0b8f /plumbing/format/index/index.go
parent64cd72debb2a94a49de5ffd3c3a6bfd626df7340 (diff)
downloadgo-git-9b75cb91384dd08eed2acce8c3099e082835da12.tar.gz
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`