Make 'git cl status' report the current branch even if there's no active CL.
TBR=ianh@google.com
Review URL: https://codereview.chromium.org/1263253002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@296187 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/git_cl.py b/git_cl.py
index e46b660..68d4339 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -795,7 +795,7 @@
if upstream_git_obj is None:
if self.GetBranch() is None:
print >> sys.stderr, (
- 'ERROR: unable to dertermine current branch (detached HEAD?)')
+ 'ERROR: unable to determine current branch (detached HEAD?)')
else:
print >> sys.stderr, (
'ERROR: no upstream branch')
@@ -1705,10 +1705,10 @@
cl = Changelist(auth_config=auth_config)
print
print 'Current branch:',
- if not cl.GetIssue():
- print 'no issue assigned.'
- return 0
print cl.GetBranch()
+ if not cl.GetIssue():
+ print 'No issue assigned.'
+ return 0
print 'Issue number: %s (%s)' % (cl.GetIssue(), cl.GetIssueURL())
if not options.fast:
print 'Issue description:'
diff --git a/tests/basic.sh b/tests/basic.sh
index 224d097..0984ae0 100755
--- a/tests/basic.sh
+++ b/tests/basic.sh
@@ -26,7 +26,7 @@
git config rietveld.server localhost:10000
test_expect_success "git-cl status has no issue" \
- "$GIT_CL_STATUS | grep -q 'no issue'"
+ "$GIT_CL_STATUS | grep -q 'No issue assigned'"
# Prevent the editor from coming up when you upload.
export GIT_EDITOR=$(which true)
diff --git a/tests/push-basic.sh b/tests/push-basic.sh
index 980d780..0d434fa 100755
--- a/tests/push-basic.sh
+++ b/tests/push-basic.sh
@@ -25,8 +25,9 @@
git config rietveld.server localhost:10000
+ # echo $($GIT_CL_STATUS)
test_expect_success "git-cl status has no issue" \
- "$GIT_CL_STATUS | grep -q 'no issue'"
+ "$GIT_CL_STATUS | grep -q 'No issue assigned'"
# Prevent the editor from coming up when you upload.
export GIT_EDITOR=$(which true)