From 54e6ed3431c559f4534210f8e5431acff0a99735 Mon Sep 17 00:00:00 2001 From: Thibault Meyer <0xbaadf00d@users.noreply.github.com> Date: Sat, 12 Nov 2016 12:09:25 +0100 Subject: [PATCH] Upgrade vendor "git" (#161) --- vendor/code.gitea.io/git/doc.go | 5 +++++ vendor/code.gitea.io/git/hook.go | 4 ++-- vendor/code.gitea.io/git/repo.go | 4 ++++ vendor/code.gitea.io/git/tree_entry.go | 8 +++----- vendor/vendor.json | 6 +++--- 5 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 vendor/code.gitea.io/git/doc.go 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 { diff --git a/vendor/vendor.json b/vendor/vendor.json index d1983ea993..168db86051 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -3,10 +3,10 @@ "ignore": "test", "package": [ { - "checksumSHA1": "K3Gp8Tv/B8otlbsOfQp3UpJGaaE=", + "checksumSHA1": "/JuXxX+Zg9lk3zvT9c82ltavFdk=", "path": "code.gitea.io/git", - "revision": "766747ef8b271a2b1142edd0a40735f556ec2c1d", - "revisionTime": "2016-11-06T09:52:37Z" + "revision": "cddfff06fa8ed36571d43c1463ea63b3e6e8244b", + "revisionTime": "2016-11-12T10:50:26Z" }, { "checksumSHA1": "/uhZZppDeb3Rbp3h8C0ALR3hdrA=",