aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com')
-rw-r--r--vendor/github.com/gogits/git-module/error.go11
-rw-r--r--vendor/github.com/gogits/git-module/git.go2
-rw-r--r--vendor/github.com/gogits/git-module/repo_pull.go10
3 files changed, 20 insertions, 3 deletions
diff --git a/vendor/github.com/gogits/git-module/error.go b/vendor/github.com/gogits/git-module/error.go
index 848bfba1..2fefaa1e 100644
--- a/vendor/github.com/gogits/git-module/error.go
+++ b/vendor/github.com/gogits/git-module/error.go
@@ -48,3 +48,14 @@ func IsErrUnsupportedVersion(err error) bool {
func (err ErrUnsupportedVersion) Error() string {
return fmt.Sprintf("Operation requires higher version [required: %s]", err.Required)
}
+
+type ErrNoMergeBase struct{}
+
+func IsErrNoMergeBase(err error) bool {
+ _, ok := err.(ErrNoMergeBase)
+ return ok
+}
+
+func (err ErrNoMergeBase) Error() string {
+ return "no merge based found"
+}
diff --git a/vendor/github.com/gogits/git-module/git.go b/vendor/github.com/gogits/git-module/git.go
index f56d054e..364ba2e9 100644
--- a/vendor/github.com/gogits/git-module/git.go
+++ b/vendor/github.com/gogits/git-module/git.go
@@ -10,7 +10,7 @@ import (
"time"
)
-const _VERSION = "0.6.1"
+const _VERSION = "0.6.2"
func Version() string {
return _VERSION
diff --git a/vendor/github.com/gogits/git-module/repo_pull.go b/vendor/github.com/gogits/git-module/repo_pull.go
index 1b0c1cf4..76efa6f4 100644
--- a/vendor/github.com/gogits/git-module/repo_pull.go
+++ b/vendor/github.com/gogits/git-module/repo_pull.go
@@ -22,7 +22,13 @@ type PullRequestInfo struct {
// GetMergeBase checks and returns merge base of two branches.
func (repo *Repository) GetMergeBase(base, head string) (string, error) {
stdout, err := NewCommand("merge-base", base, head).RunInDir(repo.Path)
- return strings.TrimSpace(stdout), err
+ if err != nil {
+ if strings.HasSuffix(err.Error(), " 1") {
+ return "", ErrNoMergeBase{}
+ }
+ return "", err
+ }
+ return strings.TrimSpace(stdout), nil
}
// GetPullRequestInfo generates and returns pull request information
@@ -47,7 +53,7 @@ func (repo *Repository) GetPullRequestInfo(basePath, baseBranch, headBranch stri
prInfo := new(PullRequestInfo)
prInfo.MergeBase, err = repo.GetMergeBase(remoteBranch, headBranch)
if err != nil {
- return nil, fmt.Errorf("GetMergeBase: %v", err)
+ return nil, err
}
logs, err := NewCommand("log", prInfo.MergeBase+"..."+headBranch, _PRETTY_LOG_FORMAT).RunInDirBytes(repo.Path)