diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2015-10-31 01:14:03 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2015-10-31 01:14:03 +0100 |
commit | c6349552c1c54ea114b92ae23fc840f68f6551f4 (patch) | |
tree | 6fbaf514ae9caf8241a0b9dfc3709d60942876c5 /tree.go | |
parent | fe1fc1aa7dca3e0f6e54ab17f0acfa45f269e58c (diff) | |
download | go-git-c6349552c1c54ea114b92ae23fc840f68f6551f4.tar.gz |
internal -> core
Diffstat (limited to 'tree.go')
-rw-r--r-- | tree.go | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -7,14 +7,14 @@ import ( "path/filepath" "strconv" - "gopkg.in/src-d/go-git.v2/internal" + "gopkg.in/src-d/go-git.v2/core" ) // Tree is basically like a directory - it references a bunch of other trees // and/or blobs (i.e. files and sub-directories) type Tree struct { Entries []TreeEntry - Hash internal.Hash + Hash core.Hash r *Repository } @@ -23,7 +23,7 @@ type Tree struct { type TreeEntry struct { Name string Mode os.FileMode - Hash internal.Hash + Hash core.Hash } func (t *Tree) Files() chan *File { @@ -40,7 +40,7 @@ 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) - if obj.Type() == internal.TreeObject { + if obj.Type() == core.TreeObject { tree := &Tree{r: t.r} tree.Decode(obj) tree.walkEntries(filepath.Join(base, entry.Name), ch) @@ -54,8 +54,8 @@ func (t *Tree) walkEntries(base string, ch chan *File) { } } -// Decode transform an internal.Object into a Tree struct -func (t *Tree) Decode(o internal.Object) error { +// Decode transform an core.Object into a Tree struct +func (t *Tree) Decode(o core.Object) error { t.Hash = o.Hash() if o.Size() == 0 { return nil @@ -82,7 +82,7 @@ func (t *Tree) Decode(o internal.Object) error { return err } - var hash internal.Hash + var hash core.Hash _, err = r.Read(hash[:]) if err != nil && err != io.EOF { return err |