aboutsummaryrefslogtreecommitdiffstats
path: root/worktree_plan9.go
diff options
context:
space:
mode:
authorFazlul Shahriar <fshahriar@gmail.com>2019-12-25 17:01:42 -0500
committerFazlul Shahriar <fshahriar@gmail.com>2019-12-25 17:01:42 -0500
commitcbc339b60d5b25ad2b2685de4303f78d0efa51fe (patch)
tree830a4f550c1f1e9cc87dcfda88d3a0b627fc624d /worktree_plan9.go
parent1a7db85bca7027d90afdb5ce711622aaac9feaed (diff)
downloadgo-git-cbc339b60d5b25ad2b2685de4303f78d0efa51fe.tar.gz
Add Plan 9 support
Not all the tests pass yet but this makes go-git usable on Plan 9. Please merge this after https://github.com/src-d/go-billy/pull/78. Fixes #756 Signed-off-by: Fazlul Shahriar <fshahriar@gmail.com>
Diffstat (limited to 'worktree_plan9.go')
-rw-r--r--worktree_plan9.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/worktree_plan9.go b/worktree_plan9.go
new file mode 100644
index 0000000..16d3915
--- /dev/null
+++ b/worktree_plan9.go
@@ -0,0 +1,31 @@
+package git
+
+import (
+ "syscall"
+ "time"
+
+ "gopkg.in/src-d/go-git.v4/plumbing/format/index"
+)
+
+func init() {
+ fillSystemInfo = func(e *index.Entry, sys interface{}) {
+ if os, ok := sys.(*syscall.Dir); ok {
+ // Plan 9 doesn't have a CreatedAt field.
+ e.CreatedAt = time.Unix(int64(os.Mtime), 0)
+
+ e.Dev = uint32(os.Dev)
+
+ // Plan 9 has no Inode.
+ // ext2srv(4) appears to store Inode in Qid.Path.
+ e.Inode = uint32(os.Qid.Path)
+
+ // Plan 9 has string UID/GID
+ e.GID = 0
+ e.UID = 0
+ }
+ }
+}
+
+func isSymlinkWindowsNonAdmin(err error) bool {
+ return true
+}