Commit e8043d11 authored by supersat@chromium.org's avatar supersat@chromium.org

Fix pulling in patches from git subrepos



git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@112765 0039d316-1c4b-4281-b951-d872f2087c98
parent 94c712fa
......@@ -500,7 +500,7 @@ or verify this branch is set up to track another (via the --track argument to
name = RunCommand(['git', 'rev-parse', 'HEAD']).strip()
# Need to pass a relative path for msysgit.
try:
files = scm.GIT.CaptureStatus([root], upstream_branch)
files = scm.GIT.CaptureStatus(root, [root], upstream_branch)
except subprocess2.CalledProcessError:
DieWithError(
('\nFailed to diff against upstream branch %s!\n\n'
......
......@@ -102,14 +102,14 @@ class GIT(object):
['git'] + args, stderr=subprocess2.PIPE, **kwargs)
@staticmethod
def CaptureStatus(files, upstream_branch=None):
def CaptureStatus(cwd, files, upstream_branch=None):
"""Returns git status.
@files can be a string (one file) or a list of files.
Returns an array of (status, file) tuples."""
if upstream_branch is None:
upstream_branch = GIT.GetUpstreamBranch(os.getcwd())
upstream_branch = GIT.GetUpstreamBranch(cwd)
if upstream_branch is None:
raise gclient_utils.Error('Cannot determine upstream branch')
command = ['diff', '--name-status', '-r', '%s...' % upstream_branch]
......
......@@ -279,7 +279,8 @@ class GIT(SCM):
logging.info("GIT(%s)" % self.checkout_root)
def CaptureStatus(self):
return scm.GIT.CaptureStatus(self.checkout_root.replace(os.sep, '/'),
return scm.GIT.CaptureStatus(self.checkout_root,
self.checkout_root.replace(os.sep, '/'),
self.diff_against)
def GenerateDiff(self):
......
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