aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/tree.go
diff options
context:
space:
mode:
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
}