mirror of
https://github.com/Luzifer/ansible-role-version.git
synced 2024-12-24 11:31:21 +00:00
21 lines
429 B
Go
21 lines
429 B
Go
|
// +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)
|
||
|
}
|
||
|
}
|
||
|
}
|