From ee87f587ea9d9b42867327db19d8b9f49f912d58 Mon Sep 17 00:00:00 2001 From: "dpranke@chromium.org" Date: Fri, 31 Jul 2015 18:46:25 +0000 Subject: [PATCH] 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 --- git_cl.py | 6 +++--- tests/basic.sh | 2 +- tests/push-basic.sh | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/git_cl.py b/git_cl.py index e46b66097..68d4339c9 100755 --- a/git_cl.py +++ b/git_cl.py @@ -795,7 +795,7 @@ or verify this branch is set up to track another (via the --track argument to 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 @@ def CMDstatus(parser, args): cl = Changelist(auth_config=auth_config) print print 'Current branch:', + print cl.GetBranch() if not cl.GetIssue(): - print 'no issue assigned.' + print 'No issue assigned.' return 0 - print cl.GetBranch() 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 224d09792..0984ae042 100755 --- a/tests/basic.sh +++ b/tests/basic.sh @@ -26,7 +26,7 @@ setup_gitsvn 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 980d78074..0d434fa7c 100755 --- a/tests/push-basic.sh +++ b/tests/push-basic.sh @@ -25,8 +25,9 @@ setup_gitgit 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)