From d79d4b8e1bcd3f8a6836471be9328ebef8ba12e9 Mon Sep 17 00:00:00 2001 From: "teravest@chromium.org" Date: Wed, 23 Oct 2013 20:09:08 +0000 Subject: [PATCH] Make "git cl issue 0" idempotent. Currently, running "git cl issue 0" in a client prints a confusing error message if there's no issue assigned. This changes the code so that the issue number isn't "unset" if it's not currently set. BUG= Review URL: https://codereview.chromium.org/32193016 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@230499 0039d316-1c4b-4281-b951-d872f2087c98 --- git_cl.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/git_cl.py b/git_cl.py index 6de71b0079..cb93095c8d 100755 --- a/git_cl.py +++ b/git_cl.py @@ -702,7 +702,9 @@ or verify this branch is set up to track another (via the --track argument to if self.rietveld_server: RunGit(['config', self._RietveldServer(), self.rietveld_server]) else: - RunGit(['config', '--unset', self._IssueSetting()]) + current_issue = self.GetIssue() + if current_issue: + RunGit(['config', '--unset', self._IssueSetting()]) self.issue = None self.SetPatchset(None)