aboutsummaryrefslogtreecommitdiffstats
path: root/worktree_windows.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-07-19 22:04:46 +0200
committerGitHub <noreply@github.com>2017-07-19 22:04:46 +0200
commit8738a04708b91683d5804b4c648c871fdeb87f82 (patch)
tree017b15080dee8bd64026c9358d832e61d12674d5 /worktree_windows.go
parent595dfe6e53a038da4949263ea2d9a7a0020c48b7 (diff)
parent4a7e7cddc0e4f88085b263693c87635254de7f35 (diff)
downloadgo-git-8738a04708b91683d5804b4c648c871fdeb87f82.tar.gz
Merge pull request #493 from src-d/windows
*: several windows support fixes
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)
+ }
+ }
+}