mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-09 09:22:48 +03:00
switch to fork of go-git
This commit is contained in:
35
vendor/github.com/jesseduffield/go-git/v5/worktree_windows.go
generated
vendored
Normal file
35
vendor/github.com/jesseduffield/go-git/v5/worktree_windows.go
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
// +build windows
|
||||
|
||||
package git
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/jesseduffield/go-git/v5/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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func isSymlinkWindowsNonAdmin(err error) bool {
|
||||
const ERROR_PRIVILEGE_NOT_HELD syscall.Errno = 1314
|
||||
|
||||
if err != nil {
|
||||
if errLink, ok := err.(*os.LinkError); ok {
|
||||
if errNo, ok := errLink.Err.(syscall.Errno); ok {
|
||||
return errNo == ERROR_PRIVILEGE_NOT_HELD
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
Reference in New Issue
Block a user