aboutsummaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
Diffstat (limited to 'vendor')
-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
-rw-r--r--vendor/vendor.json6
4 files changed, 23 insertions, 6 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)
diff --git a/vendor/vendor.json b/vendor/vendor.json
index 8e0ff422..ea8796db 100644
--- a/vendor/vendor.json
+++ b/vendor/vendor.json
@@ -183,10 +183,10 @@
"revisionTime": "2016-08-10T03:50:02Z"
},
{
- "checksumSHA1": "OmDPIa3NWPpl/rItpYC/Ig/m/gI=",
+ "checksumSHA1": "2qWMpRKKvKlGx6QlgyAWpsohrZc=",
"path": "github.com/gogits/git-module",
- "revision": "1ebf9618c02c9480312bb55bccda7886c8d4caac",
- "revisionTime": "2017-04-07T00:57:10Z"
+ "revision": "29022edafc5bd803251256f7f4bd63a0cb4b162f",
+ "revisionTime": "2017-06-05T04:08:00Z"
},
{
"checksumSHA1": "GBfb+meRaVNarQavLB/bzbDoBtY=",