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
diff --git a/git_cl.py b/git_cl.py
index 6de71b0..cb93095 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -702,7 +702,9 @@
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)