aboutsummaryrefslogtreecommitdiffstats
path: root/worktree_js.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2021-05-02 23:40:08 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2021-05-02 23:40:08 +0200
commit01df7536992af375a54bbedf45369a475953e372 (patch)
tree8435050f4388f15b3a85d135a3f7d11b1ff61540 /worktree_js.go
parent67af9d7223b0cc643025d958c592291f7475ac75 (diff)
downloadgo-git-01df7536992af375a54bbedf45369a475953e372.tar.gz
*: use go-billy instead of os calls
Diffstat (limited to 'worktree_js.go')
-rw-r--r--worktree_js.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/worktree_js.go b/worktree_js.go
new file mode 100644
index 0000000..7267d05
--- /dev/null
+++ b/worktree_js.go
@@ -0,0 +1,26 @@
+// +build js
+
+package git
+
+import (
+ "syscall"
+ "time"
+
+ "github.com/go-git/go-git/v5/plumbing/format/index"
+)
+
+func init() {
+ fillSystemInfo = func(e *index.Entry, sys interface{}) {
+ if os, ok := sys.(*syscall.Stat_t); ok {
+ e.CreatedAt = time.Unix(int64(os.Ctime), int64(os.CtimeNsec))
+ e.Dev = uint32(os.Dev)
+ e.Inode = uint32(os.Ino)
+ e.GID = os.Gid
+ e.UID = os.Uid
+ }
+ }
+}
+
+func isSymlinkWindowsNonAdmin(err error) bool {
+ return false
+}