Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: git_cl.py

Issue 86133002: Fix "git cl diff" when run on branch without an issue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index 03bd879cc68db86b430a0fb4386284cec3e997b1..3cb66231ff896fba995c2e60c8d77b250fe021ce 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -2160,7 +2160,10 @@ def CMDset_close(parser, args):
def CMDdiff(parser, args):
"""shows differences between local tree and last upload."""
cl = Changelist()
+ issue = cl.GetIssue()
branch = cl.GetBranch()
+ if not issue:
+ DieWithError('No issue found for current branch (%s)' % branch)
TMP_BRANCH = 'git-cl-diff'
base_branch = RunGit(['merge-base', cl.GetUpstreamBranch(), 'HEAD']).strip()
@@ -2168,7 +2171,7 @@ def CMDdiff(parser, args):
RunGit(['checkout', '-q', '-b', TMP_BRANCH, base_branch])
try:
# Patch in the latest changes from rietveld.
- rtn = PatchIssue(cl.GetIssue(), False, False, None)
+ rtn = PatchIssue(issue, False, False, None)
if rtn != 0:
return rtn
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698