aboutsummaryrefslogtreecommitdiffstats
path: root/worktree_windows.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-07-19 00:09:39 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2017-07-19 00:09:39 +0200
commit1675edbff5055189d958244b6e0ded9f5d37fe91 (patch)
tree61a73a8008e460120c7f2a6880af1d3498c8d275 /worktree_windows.go
parentae80735ce2171aff4c44313b3c27eb5ddb595385 (diff)
downloadgo-git-1675edbff5055189d958244b6e0ded9f5d37fe91.tar.gz
worktree: fix file system info in windows
Diffstat (limited to 'worktree_windows.go')
-rw-r--r--worktree_windows.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/worktree_windows.go b/worktree_windows.go
new file mode 100644
index 0000000..d59448e
--- /dev/null
+++ b/worktree_windows.go
@@ -0,0 +1,20 @@
+// +build windows
+
+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.Win32FileAttributeData); ok {
+ seconds := os.CreationTime.Nanoseconds() / 1000000000
+ nanoseconds := os.CreationTime.Nanoseconds() - seconds*1000000000
+ e.CreatedAt = time.Unix(seconds, nanoseconds)
+ }
+ }
+}