diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-01-08 17:01:36 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-01-08 17:01:36 +0100 |
commit | cebec78608e7913b8c843390237fd609069022ae (patch) | |
tree | f220b82b1bd3aece0d0a4d0d5d38537c45ecea86 /tree.go | |
parent | da5ab9de3e4c1bffa533108f46c5adc30929f7c2 (diff) | |
parent | 3ba036079b8e7a08302282b546cff6df628cb6db (diff) | |
download | go-git-cebec78608e7913b8c843390237fd609069022ae.tar.gz |
Merge pull request #11 from alcortesm/ignore-submodulesv2.1.1
Ignore submodule dirs (empty directories without associated object)
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) |