diff options
Diffstat (limited to 'worktree_windows.go')
-rw-r--r-- | worktree_windows.go | 20 |
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) + } + } +} |