diff options
| author | Carlos Martín Nieto <[email protected]> | 2013-09-09 14:21:16 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <[email protected]> | 2013-09-09 14:21:16 +0200 |
| commit | 3cbfdf37f48c7b2f8726ad7e60a963cae1d8fd21 (patch) | |
| tree | 024cf8bf2de8962c862232390ff212ff342e4d7a /tree.go | |
| parent | 22f43840aac638b43bc963a6515c9c814bac3b72 (diff) | |
Add Filemode to TreeEntry
This field was missing, so let's add it, and let's add the const
definitions for the modes while we're here.
Diffstat (limited to 'tree.go')
| -rw-r--r-- | tree.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -13,6 +13,15 @@ import ( "unsafe" ) +const ( + FilemodeNew = C.GIT_FILEMODE_NEW + FilemodeTree = C.GIT_FILEMODE_TREE + FilemodeBlob = C.GIT_FILEMODE_BLOB + FilemodeBlobExecutable = C.GIT_FILEMODE_BLOB_EXECUTABLE + FilemodeLink = C.GIT_FILEMODE_LINK + FilemodeCommit = C.GIT_FILEMODE_COMMIT +) + type Tree struct { gitObject } @@ -21,6 +30,7 @@ type TreeEntry struct { Name string Id *Oid Type ObjectType + Filemode int } func newTreeEntry(entry *C.git_tree_entry) *TreeEntry { @@ -28,6 +38,7 @@ func newTreeEntry(entry *C.git_tree_entry) *TreeEntry { C.GoString(C.git_tree_entry_name(entry)), newOidFromC(C.git_tree_entry_id(entry)), ObjectType(C.git_tree_entry_type(entry)), + int(C.git_tree_entry_filemode(entry)), } } |
