Commit d67e7158 authored by Daniel Cheng's avatar Daniel Cheng Committed by Commit Bot

Fix GetOldContents() to return an empty string if the file didn't exist.

Bug: 700108
Change-Id: I9010aa3b4aa467c91b93ffac924b3ec5a16cfaa2
Reviewed-on: https://chromium-review.googlesource.com/476590Reviewed-by: 's avatarJochen Eisinger <jochen@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
parent 3a3de33b
......@@ -259,7 +259,10 @@ class GIT(object):
if not branch:
branch = GIT.GetUpstreamBranch(cwd)
command = ['show', '%s:%s' % (branch, filename)]
return GIT.Capture(command, cwd=cwd, strip_out=False)
try:
return GIT.Capture(command, cwd=cwd, strip_out=False)
except subprocess2.CalledProcessError:
return ''
@staticmethod
def GenerateDiff(cwd, branch=None, branch_head='HEAD', full_move=False,
......
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