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

Unified Diff: git_cl.py

Issue 1867073002: Slight refactor git cl diff. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 8 months 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 fb12eafe9af6f444b916a00a09a0225b7aafe1fd..b6d32d15a6a6c0448b6a7210e962c794b4de59c9 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -992,6 +992,10 @@ class Changelist(object):
self.GetBranch() # Poke the lazy loader.
return self.branchref
+ def ClearBranch(self):
+ """Clears cached branch data of this object."""
+ self.branch = self.branchref = None
+
@staticmethod
def FetchUpstreamTuple(branch):
"""Returns a tuple containing remote and remote ref,
@@ -4317,9 +4321,9 @@ def CMDdiff(parser, args):
# Create a new branch based on the merge-base
RunGit(['checkout', '-q', '-b', TMP_BRANCH, base_branch])
- # Update the cached branch in cl instance, to avoid overwriting original
- # branch properties.
- cl.branch = cl.branchref = None
+ # Clear cached branch in cl object, to avoid overwriting original CL branch
+ # properties.
+ cl.ClearBranch()
try:
rtn = cl.CMDPatchIssue(issue, reject=False, nocommit=False, directory=None)
if rtn != 0:
« 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