Slight refactor git cl diff.
R=machenbach@chromium.org
BUG=
Review URL: https://codereview.chromium.org/1867073002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299769 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/git_cl.py b/git_cl.py
index fb12eaf..b6d32d1 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -992,6 +992,10 @@
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 @@
# 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: