Commit 534f67a1 authored by tandrii@chromium.org's avatar tandrii@chromium.org

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
parent ef7c68c5
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment