Commit 93aa0739 authored by rob@robwu.nl's avatar rob@robwu.nl

git-drover: Correctly resolve --parent_checkout

git rev-parse --git-dir returns a relative path, e.g. ".git". This
should be resolved relative to the cwd of the git command instead of the
current working dir. The cwd of the git command is set to _parent_repo
(=the absolute path after resolving --parent_checkout), so use that.

TEST=The following completes without errors.
$ cd /tmp
$ git init somegitrepo
$ cd somegitrepo
$ git drover --branch [branch] --cherry-pick [hash] -v --dry-run --parent_checkout /path/to/src
$ cd /path/to/src
$ git drover --branch [branch] --cherry-pick [hash] -v --dry-run

Review URL: https://codereview.chromium.org/1640233002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@298416 0039d316-1c4b-4281-b951-d872f2087c98
parent d0e1bede
......@@ -227,7 +227,7 @@ class _Drover(object):
This is so the new workdir can be a sparse checkout without affecting
|self._parent_repo|.
"""
parent_git_dir = os.path.abspath(self._run_git_command(
parent_git_dir = os.path.join(self._parent_repo, self._run_git_command(
['rev-parse', '--git-dir']).strip())
self._workdir = tempfile.mkdtemp(prefix='drover_%s_' % self._branch)
logging.debug('Creating checkout in %s', self._workdir)
......
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