From 83381056f5e9736dd66d07a1d15d495f89d9a34c Mon Sep 17 00:00:00 2001 From: wardn Date: Tue, 10 Apr 2018 14:08:25 -0700 Subject: use bsd superset for conditional compilation Signed-off-by: wardn --- worktree_bsd.go | 26 ++++++++++++++++++++++++++ worktree_darwin.go | 26 -------------------------- 2 files changed, 26 insertions(+), 26 deletions(-) create mode 100644 worktree_bsd.go delete mode 100644 worktree_darwin.go diff --git a/worktree_bsd.go b/worktree_bsd.go new file mode 100644 index 0000000..3b374c7 --- /dev/null +++ b/worktree_bsd.go @@ -0,0 +1,26 @@ +// +build darwin freebsd netbsd openbsd + +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.Stat_t); ok { + e.CreatedAt = time.Unix(int64(os.Atimespec.Sec), int64(os.Atimespec.Nsec)) + 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 +} diff --git a/worktree_darwin.go b/worktree_darwin.go deleted file mode 100644 index 3b374c7..0000000 --- a/worktree_darwin.go +++ /dev/null @@ -1,26 +0,0 @@ -// +build darwin freebsd netbsd openbsd - -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.Stat_t); ok { - e.CreatedAt = time.Unix(int64(os.Atimespec.Sec), int64(os.Atimespec.Nsec)) - 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 -} -- cgit