diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2016-12-22 17:30:52 +0800 |
---|---|---|
committer | Thomas Boerger <thomas@webhippie.de> | 2016-12-22 10:30:52 +0100 |
commit | 47a7529d9655e11471bbe39958222a13854a6133 (patch) | |
tree | 98e597255245e17d39a0062c3977fb8a510cf413 /vendor/code.gitea.io/git/repo.go | |
parent | 0c5c34d7ddaf31a6d8123dac36b221de61f5ff96 (diff) | |
download | gitea-47a7529d9655e11471bbe39958222a13854a6133.tar.gz gitea-47a7529d9655e11471bbe39958222a13854a6133.zip |
update code.gitea.io/git (#450)
Diffstat (limited to 'vendor/code.gitea.io/git/repo.go')
-rw-r--r-- | vendor/code.gitea.io/git/repo.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/vendor/code.gitea.io/git/repo.go b/vendor/code.gitea.io/git/repo.go index 3d6c138c79..e596b74b9d 100644 --- a/vendor/code.gitea.io/git/repo.go +++ b/vendor/code.gitea.io/git/repo.go @@ -18,11 +18,11 @@ import ( type Repository struct { Path string - commitCache *objectCache - tagCache *objectCache + commitCache *ObjectCache + tagCache *ObjectCache } -const _PRETTY_LOG_FORMAT = `--pretty=format:%H` +const prettyLogFormat = `--pretty=format:%H` func (repo *Repository) parsePrettyFormatLogToList(logs []byte) (*list.List, error) { l := list.New() @@ -32,8 +32,8 @@ func (repo *Repository) parsePrettyFormatLogToList(logs []byte) (*list.List, err parts := bytes.Split(logs, []byte{'\n'}) - for _, commitId := range parts { - commit, err := repo.GetCommit(string(commitId)) + for _, commitID := range parts { + commit, err := repo.GetCommit(string(commitID)) if err != nil { return nil, err } @@ -80,6 +80,7 @@ func OpenRepository(repoPath string) (*Repository, error) { }, nil } +// CloneRepoOptions options when clone a repository type CloneRepoOptions struct { Timeout time.Duration Mirror bool @@ -118,6 +119,7 @@ func Clone(from, to string, opts CloneRepoOptions) (err error) { return err } +// PullRemoteOptions options when pull from remote type PullRemoteOptions struct { Timeout time.Duration All bool @@ -153,6 +155,7 @@ func Push(repoPath, remote, branch string) error { return err } +// CheckoutOptions options when heck out some branch type CheckoutOptions struct { Timeout time.Duration Branch string |