mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-11 00:49:31 +00:00
Implement git refs API for listing references (branches, tags and other) (#5354)
* Inital routes to git refs api * Git refs API implementation * Update swagger * Fix copyright * Make swagger happy add basic test * Fix test * Fix test again :)
This commit is contained in:
parent
294904321c
commit
08bf443016
268 changed files with 48603 additions and 10 deletions
35
vendor/gopkg.in/src-d/go-git.v4/worktree_windows.go
generated
vendored
Normal file
35
vendor/gopkg.in/src-d/go-git.v4/worktree_windows.go
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
// +build windows
|
||||
|
||||
package git
|
||||
|
||||
import (
|
||||
"os"
|
||||
"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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue