Commit 323ec375 authored by halton.huo@intel.com's avatar halton.huo@intel.com

Do not assign revision when checking the commit existence.

'git rev-parse <revision> will return same revision result with
newline appended if revision exists. The newline will cause the
following checkout command will fail, so remove the assignment.

BUG=
R=agable@chromium.org, rogerta@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@277615 0039d316-1c4b-4281-b951-d872f2087c98
parent 617a1617
......@@ -594,11 +594,11 @@ class GitCheckout(CheckoutBase):
try:
# Look if the commit hash already exist. If so, we can skip a
# 'git fetch' call.
revision = self._check_output_git(['rev-parse', revision])
revision = self._check_output_git(['rev-parse', revision]).rstrip()
except subprocess.CalledProcessError:
self._check_call_git(
['fetch', self.remote, self.remote_branch, '--quiet'])
revision = self._check_output_git(['rev-parse', revision])
revision = self._check_output_git(['rev-parse', revision]).rstrip()
self._check_call_git(['checkout', '--force', '--quiet', revision])
else:
branches, active = self._branches()
......
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