diff options
author | Thibault Meyer <0xbaadf00d@users.noreply.github.com> | 2016-11-12 12:09:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-12 12:09:25 +0100 |
commit | 54e6ed3431c559f4534210f8e5431acff0a99735 (patch) | |
tree | df696dd6f09e822354318b42f700ff1a7da49aeb /vendor/code.gitea.io | |
parent | b339858500d3c0faf8c37ee786c22657c60a5833 (diff) | |
download | gitea-54e6ed3431c559f4534210f8e5431acff0a99735.tar.gz gitea-54e6ed3431c559f4534210f8e5431acff0a99735.zip |
Upgrade vendor "git" (#161)
Diffstat (limited to 'vendor/code.gitea.io')
-rw-r--r-- | vendor/code.gitea.io/git/doc.go | 5 | ||||
-rw-r--r-- | vendor/code.gitea.io/git/hook.go | 4 | ||||
-rw-r--r-- | vendor/code.gitea.io/git/repo.go | 4 | ||||
-rw-r--r-- | vendor/code.gitea.io/git/tree_entry.go | 8 |
4 files changed, 14 insertions, 7 deletions
diff --git a/vendor/code.gitea.io/git/doc.go b/vendor/code.gitea.io/git/doc.go new file mode 100644 index 0000000000..1941d28550 --- /dev/null +++ b/vendor/code.gitea.io/git/doc.go @@ -0,0 +1,5 @@ +// Copyright 2016 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package git // import "code.gitea.io/git" diff --git a/vendor/code.gitea.io/git/hook.go b/vendor/code.gitea.io/git/hook.go index 086bf7126d..20da99392a 100644 --- a/vendor/code.gitea.io/git/hook.go +++ b/vendor/code.gitea.io/git/hook.go @@ -102,13 +102,13 @@ func ListHooks(repoPath string) (_ []*Hook, err error) { } const ( - HookPathUpdate = "hooks/update" + HOOK_PATH_UPDATE = "hooks/update" ) // SetUpdateHook writes given content to update hook of the reposiotry. func SetUpdateHook(repoPath, content string) (err error) { log("Setting update hook: %s", repoPath) - hookPath := path.Join(repoPath, HookPathUpdate) + hookPath := path.Join(repoPath, HOOK_PATH_UPDATE) if com.IsExist(hookPath) { err = os.Remove(hookPath) } else { diff --git a/vendor/code.gitea.io/git/repo.go b/vendor/code.gitea.io/git/repo.go index bfc2cbe7c8..3d6c138c79 100644 --- a/vendor/code.gitea.io/git/repo.go +++ b/vendor/code.gitea.io/git/repo.go @@ -121,6 +121,7 @@ func Clone(from, to string, opts CloneRepoOptions) (err error) { type PullRemoteOptions struct { Timeout time.Duration All bool + Rebase bool Remote string Branch string } @@ -128,6 +129,9 @@ type PullRemoteOptions struct { // Pull pulls changes from remotes. func Pull(repoPath string, opts PullRemoteOptions) error { cmd := NewCommand("pull") + if opts.Rebase { + cmd.AddArguments("--rebase") + } if opts.All { cmd.AddArguments("--all") } else { diff --git a/vendor/code.gitea.io/git/tree_entry.go b/vendor/code.gitea.io/git/tree_entry.go index 1c9e89d70c..17adf0ac1b 100644 --- a/vendor/code.gitea.io/git/tree_entry.go +++ b/vendor/code.gitea.io/git/tree_entry.go @@ -11,7 +11,6 @@ import ( "sort" "strconv" "strings" - "time" ) type EntryMode int @@ -94,11 +93,11 @@ func (tes Entries) Less(i, j int) bool { t1, t2 := tes[i], tes[j] var k int for k = 0; k < len(sorter)-1; k++ { - sort := sorter[k] + s := sorter[k] switch { - case sort(t1, t2): + case s(t1, t2): return true - case sort(t2, t1): + case s(t2, t1): return false } } @@ -157,7 +156,6 @@ func (tes Entries) GetCommitsInfo(commit *Commit, treePath string) ([][]interfac if tes[i].Type != OBJECT_COMMIT { go func(i int) { - time.Sleep(200 * time.Millisecond) cinfo := commitInfo{entryName: tes[i].Name()} c, err := commit.GetCommitByPath(filepath.Join(treePath, tes[i].Name())) if err != nil { |