[git rebase-update] Handle error when chdir'ing to original workdir.

BUG=

Change-Id: I1dc7f20eea3f4b1be9179aa6d77bdee08ab8a04f
Reviewed-on: https://chromium-review.googlesource.com/431576
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
changes/76/431576/2
Robert Iannucci 8 years ago committed by Commit Bot
parent d0e1d9d9c5
commit c87e36aaec

@ -311,8 +311,16 @@ def main(args=None):
% (return_branch, root_branch) % (return_branch, root_branch)
) )
git.run('checkout', root_branch) git.run('checkout', root_branch)
# return_workdir may also not be there any more.
if return_workdir: if return_workdir:
try:
os.chdir(return_workdir) os.chdir(return_workdir)
except OSError as e:
print (
"Unable to return to original workdir %r: %s"
% (return_workdir, e)
)
git.set_config(STARTING_BRANCH_KEY, '') git.set_config(STARTING_BRANCH_KEY, '')
git.set_config(STARTING_WORKDIR_KEY, '') git.set_config(STARTING_WORKDIR_KEY, '')

Loading…
Cancel
Save