diff options
author | Alberto Cortés <alberto@sourced.tech> | 2016-01-08 16:04:29 +0100 |
---|---|---|
committer | Alberto Cortés <alberto@sourced.tech> | 2016-01-08 16:49:10 +0100 |
commit | 3ba036079b8e7a08302282b546cff6df628cb6db (patch) | |
tree | f220b82b1bd3aece0d0a4d0d5d38537c45ecea86 /tree.go | |
parent | da5ab9de3e4c1bffa533108f46c5adc30929f7c2 (diff) | |
download | go-git-3ba036079b8e7a08302282b546cff6df628cb6db.tar.gz |
Ignore submodule dirs (empty directories without associated object), add empty dir test
Diffstat (limited to 'tree.go')
-rw-r--r-- | tree.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -39,7 +39,11 @@ func (t *Tree) Files() chan *File { func (t *Tree) walkEntries(base string, ch chan *File) { for _, entry := range t.Entries { - obj, _ := t.r.Storage.Get(entry.Hash) + obj, ok := t.r.Storage.Get(entry.Hash) + if !ok { + continue // ignore entries without hash (= submodule dirs) + } + if obj.Type() == core.TreeObject { tree := &Tree{r: t.r} tree.Decode(obj) |