aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/tree.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-01-28 21:38:29 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2017-01-28 21:38:29 +0100
commitcf9efc629eae67dc5c05c06e3cb0470bb1696f73 (patch)
tree2209ee0d8a6e16b55f5e9d0053f7d86385064333 /plumbing/object/tree.go
parent60124e2bfd15c76738d429368b05a13f537a27d9 (diff)
downloadgo-git-cf9efc629eae67dc5c05c06e3cb0470bb1696f73.tar.gz
object: modes in TreeEntry as os.FileMode, and not the git internal
Diffstat (limited to 'plumbing/object/tree.go')
-rw-r--r--plumbing/object/tree.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/plumbing/object/tree.go b/plumbing/object/tree.go
index f3e03bc..b7681f3 100644
--- a/plumbing/object/tree.go
+++ b/plumbing/object/tree.go
@@ -18,8 +18,12 @@ import (
const (
maxTreeDepth = 1024
startingStackSize = 8
- submoduleMode = 0160000
- directoryMode = 0040000
+
+ fileMode = 0100644
+ executableMode = 0100755
+ submoduleMode = 0160000
+ symlinkMode = 0120000
+ treeMode = 0040000
)
// New errors defined by this package.
@@ -240,9 +244,13 @@ func (t *Tree) decodeFileMode(mode string) (os.FileMode, error) {
m := os.FileMode(fm)
switch fm {
- case 0040000: //tree
+ case fileMode:
+ m = 0644
+ case executableMode:
+ m = 0755
+ case treeMode:
m = m | os.ModeDir
- case 0120000: //symlink
+ case symlinkMode:
m = m | os.ModeSymlink
}