aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-06-17 13:11:23 -0400
committerRuss Cox <rsc@golang.org>2015-06-17 20:27:57 +0000
commitfb15fb95a06eea1440b2f28b5dadcec5bbb6e8fa (patch)
tree323c6f72a0a343d54d6e5a5c827cd143f4517e8e
parent4d44a014ced4b854db2d13ad95888aa189cc9967 (diff)
downloadgo-x-review-fb15fb95a06eea1440b2f28b5dadcec5bbb6e8fa.tar.xz
git-codereview: fix missing upstream detection
With git 2.4.3, the current tests fail (and it breaks in real use): $ go test git rev-parse --abbrev-ref newbranch@{u} fatal: no upstream configured for branch 'newbranch' git-codereview: exit status 128 exit status 1 FAIL golang.org/x/review/git-codereview 0.361s $ The message changed from "No" to "no". Fix detection. Change-Id: I814a7cec612fc12496ef89ccfd80fb70c09d4e46 Reviewed-on: https://go-review.googlesource.com/11172 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
-rw-r--r--git-codereview/branch.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-codereview/branch.go b/git-codereview/branch.go
index cabe7f6..5eacb10 100644
--- a/git-codereview/branch.go
+++ b/git-codereview/branch.go
@@ -72,7 +72,9 @@ func (b *Branch) OriginBranch() string {
b.originBranch = string(bytes.TrimSpace(out))
return b.originBranch
}
- if strings.Contains(string(out), "No upstream configured") {
+
+ // Have seen both "No upstream configured" and "no upstream configured".
+ if strings.Contains(string(out), "upstream configured") {
// Assume branch was created before we set upstream correctly.
b.originBranch = "origin/master"
return b.originBranch