Commit b65040ab authored by nasser@codeaurora.org's avatar nasser@codeaurora.org

Fix a FetchUpstreamTuple cwd bug

in_directory was not being set to the correct cwd. This caused commands to
always run in the dir from which gclient was executed.

Review URL: http://codereview.chromium.org/554142

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@37697 0039d316-1c4b-4281-b951-d872f2087c98
parent e42a1939
......@@ -205,20 +205,16 @@ class GIT(object):
branch = GIT.GetBranch(cwd)
upstream_branch = None
upstream_branch = GIT.Capture(
['config', 'branch.%s.merge' % branch], error_ok=True)[0].strip()
['config', 'branch.%s.merge' % branch], in_directory=cwd,
error_ok=True)[0].strip()
if upstream_branch:
remote = GIT.Capture(
['config', 'branch.%s.remote' % branch],
error_ok=True)[0].strip()
in_directory=cwd, error_ok=True)[0].strip()
else:
# Fall back on trying a git-svn upstream branch.
if GIT.IsGitSvn(cwd):
upstream_branch = GIT.GetSVNBranch(cwd)
# Fall back on origin/master if it exits.
if not upstream_branch:
GIT.Capture(['branch', '-r'])[0].split().count('origin/master')
remote = 'origin'
upstream_branch = 'refs/heads/master'
return remote, upstream_branch
@staticmethod
......
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