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/476590
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
changes/90/476590/2
Daniel Cheng 8 years ago committed by Commit Bot
parent 3a3de33b72
commit d67e7158df

@ -259,7 +259,10 @@ class GIT(object):
if not branch:
branch = GIT.GetUpstreamBranch(cwd)
command = ['show', '%s:%s' % (branch, filename)]
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,

Loading…
Cancel
Save