mirror of https://github.com/go-gitea/gitea.git
Upgrade vendor "git" (#161)
This commit is contained in:
parent
b339858500
commit
54e6ed3431
|
@ -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"
|
|
@ -102,13 +102,13 @@ func ListHooks(repoPath string) (_ []*Hook, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
HookPathUpdate = "hooks/update"
|
HOOK_PATH_UPDATE = "hooks/update"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SetUpdateHook writes given content to update hook of the reposiotry.
|
// SetUpdateHook writes given content to update hook of the reposiotry.
|
||||||
func SetUpdateHook(repoPath, content string) (err error) {
|
func SetUpdateHook(repoPath, content string) (err error) {
|
||||||
log("Setting update hook: %s", repoPath)
|
log("Setting update hook: %s", repoPath)
|
||||||
hookPath := path.Join(repoPath, HookPathUpdate)
|
hookPath := path.Join(repoPath, HOOK_PATH_UPDATE)
|
||||||
if com.IsExist(hookPath) {
|
if com.IsExist(hookPath) {
|
||||||
err = os.Remove(hookPath)
|
err = os.Remove(hookPath)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -121,6 +121,7 @@ func Clone(from, to string, opts CloneRepoOptions) (err error) {
|
||||||
type PullRemoteOptions struct {
|
type PullRemoteOptions struct {
|
||||||
Timeout time.Duration
|
Timeout time.Duration
|
||||||
All bool
|
All bool
|
||||||
|
Rebase bool
|
||||||
Remote string
|
Remote string
|
||||||
Branch string
|
Branch string
|
||||||
}
|
}
|
||||||
|
@ -128,6 +129,9 @@ type PullRemoteOptions struct {
|
||||||
// Pull pulls changes from remotes.
|
// Pull pulls changes from remotes.
|
||||||
func Pull(repoPath string, opts PullRemoteOptions) error {
|
func Pull(repoPath string, opts PullRemoteOptions) error {
|
||||||
cmd := NewCommand("pull")
|
cmd := NewCommand("pull")
|
||||||
|
if opts.Rebase {
|
||||||
|
cmd.AddArguments("--rebase")
|
||||||
|
}
|
||||||
if opts.All {
|
if opts.All {
|
||||||
cmd.AddArguments("--all")
|
cmd.AddArguments("--all")
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -11,7 +11,6 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type EntryMode int
|
type EntryMode int
|
||||||
|
@ -94,11 +93,11 @@ func (tes Entries) Less(i, j int) bool {
|
||||||
t1, t2 := tes[i], tes[j]
|
t1, t2 := tes[i], tes[j]
|
||||||
var k int
|
var k int
|
||||||
for k = 0; k < len(sorter)-1; k++ {
|
for k = 0; k < len(sorter)-1; k++ {
|
||||||
sort := sorter[k]
|
s := sorter[k]
|
||||||
switch {
|
switch {
|
||||||
case sort(t1, t2):
|
case s(t1, t2):
|
||||||
return true
|
return true
|
||||||
case sort(t2, t1):
|
case s(t2, t1):
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -157,7 +156,6 @@ func (tes Entries) GetCommitsInfo(commit *Commit, treePath string) ([][]interfac
|
||||||
|
|
||||||
if tes[i].Type != OBJECT_COMMIT {
|
if tes[i].Type != OBJECT_COMMIT {
|
||||||
go func(i int) {
|
go func(i int) {
|
||||||
time.Sleep(200 * time.Millisecond)
|
|
||||||
cinfo := commitInfo{entryName: tes[i].Name()}
|
cinfo := commitInfo{entryName: tes[i].Name()}
|
||||||
c, err := commit.GetCommitByPath(filepath.Join(treePath, tes[i].Name()))
|
c, err := commit.GetCommitByPath(filepath.Join(treePath, tes[i].Name()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
"ignore": "test",
|
"ignore": "test",
|
||||||
"package": [
|
"package": [
|
||||||
{
|
{
|
||||||
"checksumSHA1": "K3Gp8Tv/B8otlbsOfQp3UpJGaaE=",
|
"checksumSHA1": "/JuXxX+Zg9lk3zvT9c82ltavFdk=",
|
||||||
"path": "code.gitea.io/git",
|
"path": "code.gitea.io/git",
|
||||||
"revision": "766747ef8b271a2b1142edd0a40735f556ec2c1d",
|
"revision": "cddfff06fa8ed36571d43c1463ea63b3e6e8244b",
|
||||||
"revisionTime": "2016-11-06T09:52:37Z"
|
"revisionTime": "2016-11-12T10:50:26Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "/uhZZppDeb3Rbp3h8C0ALR3hdrA=",
|
"checksumSHA1": "/uhZZppDeb3Rbp3h8C0ALR3hdrA=",
|
||||||
|
|
Loading…
Reference in New Issue