mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
Revert "Error out of rebase-update if there are uncommitted changes"
This reverts commit eff810e93d.
Reason for revert: breaks workflows for users
Original change's description:
> Error out of rebase-update if there are uncommitted changes
>
> Currently, running rebase-update may lead to missing untracked files.
> This change prints an error instead freezing and thawing local changes.
>
> Bug: 1251047
> Change-Id: Ia5f718ed957dae936d2ead2778760ae0c8d9f9ea
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3171828
> Commit-Queue: Gavin Mak <gavinmak@google.com>
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Bug: 1251047
Change-Id: I5b61dc1c7af13ccca6ea80baecff0522291083c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3191674
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
This commit is contained in:
@@ -256,9 +256,12 @@ def main(args=None):
|
||||
return_branch, return_workdir = find_return_branch_workdir()
|
||||
os.chdir(git.run('rev-parse', '--show-toplevel'))
|
||||
|
||||
if git.run('status', '--porcelain'):
|
||||
print('Cannot rebase-update with uncommitted changes.')
|
||||
return 1
|
||||
if git.current_branch() == 'HEAD':
|
||||
if git.run('status', '--porcelain'):
|
||||
print('Cannot rebase-update with detached head + uncommitted changes.')
|
||||
return 1
|
||||
else:
|
||||
git.freeze() # just in case there are any local changes.
|
||||
|
||||
branches_to_rebase = set(opts.branches)
|
||||
if opts.current:
|
||||
@@ -319,6 +322,7 @@ def main(args=None):
|
||||
# return_branch may not be there any more.
|
||||
if return_branch in git.branches():
|
||||
git.run('checkout', return_branch)
|
||||
git.thaw()
|
||||
else:
|
||||
root_branch = git.root()
|
||||
if return_branch != 'HEAD':
|
||||
|
||||
Reference in New Issue
Block a user