Skip to content

utils/update-checkout: Do any git checkout before the git fetch. #7165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 31, 2017

Conversation

erg
Copy link
Contributor

@erg erg commented Jan 31, 2017

Calling git fetch updates .git/FETCH_HEAD and marks all branches
besides the currently checked out branch as not-for-merge. So to
ensure that the branch we want to merge is available for merging, we
must do a checkout of that branch before updating the FETCH_HEAD file.

Fixes #46385.

@erg erg force-pushed the fix-update-checkout-fetch branch 2 times, most recently from 49a6634 to 3e6d7c3 Compare January 31, 2017 19:18
@erg
Copy link
Contributor Author

erg commented Jan 31, 2017

@swift-ci Please smoke test

@erg erg force-pushed the fix-update-checkout-fetch branch 2 times, most recently from bfdc39b to 7e865fd Compare January 31, 2017 20:41
@erg
Copy link
Contributor Author

erg commented Jan 31, 2017

@swift-ci Please smoke test

utils/update-checkout: Add a call to ``git rebase --abort`` when using the ``--clean`` option.
Calling ``git fetch`` updates .git/FETCH_HEAD and marks all branches
besides the currently checked out branch as not-for-merge. So tot
ensure that the branch we want to merge is available for merging, we
must do a checkout of that branch before updating the FETCH_HEAD file.

We also must ensure that we have fetched before optionally resetting to remote.

Fixes https://bugs.swift.org/browse/SR-3800.

The --clean option is meant to restore your repository to a pristine
condition, but there are cases where you can ``reset --hard`` and still be
in the middle of a rebase. This is annoying across 10+ repositories, so
if the user wants to --clean, then abort all rebases in progress.
@erg erg force-pushed the fix-update-checkout-fetch branch from 7e865fd to 07ddf07 Compare January 31, 2017 20:48
@erg
Copy link
Contributor Author

erg commented Jan 31, 2017

@swift-ci Please smoke test

@erg erg merged commit bcdb4cf into swiftlang:master Jan 31, 2017
@AnthonyLatsis AnthonyLatsis added the update-checkout Area → utils: the `update-checkout` script label Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
update-checkout Area → utils: the `update-checkout` script
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants