diff options
author | Unknwon <u@gogs.io> | 2015-11-03 22:49:06 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-03 22:49:06 -0500 |
commit | 3a81fdf092a39cc94f3bb896a42db8546bd5f39a (patch) | |
tree | a436e2de1aaafab77e985c550b165df7dc12f3ae /modules/git/tree.go | |
parent | 6f0a41b8b28ba33382ab8d655c0d015324be7647 (diff) | |
download | gitea-3a81fdf092a39cc94f3bb896a42db8546bd5f39a.tar.gz gitea-3a81fdf092a39cc94f3bb896a42db8546bd5f39a.zip |
rename fields
Diffstat (limited to 'modules/git/tree.go')
-rw-r--r-- | modules/git/tree.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/git/tree.go b/modules/git/tree.go index 27539f06b2..cc62a2d528 100644 --- a/modules/git/tree.go +++ b/modules/git/tree.go @@ -18,7 +18,7 @@ var ( // A tree is a flat directory listing. type Tree struct { - Id sha1 + ID sha1 repo *Repository // parent tree @@ -66,7 +66,7 @@ func parseTreeData(tree *Tree, data []byte) ([]*TreeEntry, error) { if err != nil { return nil, err } - entry.Id = id + entry.ID = id pos += step + 1 // Skip half of sha1. step = bytes.IndexByte(data[pos:], '\n') @@ -100,7 +100,7 @@ func (t *Tree) SubTree(rpath string) (*Tree, error) { return nil, err } - g, err = t.repo.getTree(te.Id) + g, err = t.repo.getTree(te.ID) if err != nil { return nil, err } @@ -117,7 +117,7 @@ func (t *Tree) ListEntries(relpath string) (Entries, error) { t.entriesParsed = true stdout, stderr, err := com.ExecCmdDirBytes(t.repo.Path, - "git", "ls-tree", t.Id.String()) + "git", "ls-tree", t.ID.String()) if err != nil { if strings.Contains(err.Error(), "exit status 128") { return nil, errors.New(strings.TrimSpace(string(stderr))) @@ -130,7 +130,7 @@ func (t *Tree) ListEntries(relpath string) (Entries, error) { func NewTree(repo *Repository, id sha1) *Tree { tree := new(Tree) - tree.Id = id + tree.ID = id tree.repo = repo return tree } |