Per document:
> -f, --force
> When git fetch is used with <rbranch>:<lbranch> refspec, it refuses
> to update the local branch <lbranch> unless the remote branch
> <rbranch> it fetches is a descendant of <lbranch>. This option
> overrides that check.
When there are merge conflicts we fail pretty hard. This is still
possible after this commit but at least we've given Git enough pointers
to make it less likely.
ClosesHomebrew/homebrew#49299.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This should help to prevent situations where a user accidentally ends up
"stranded" in a branch indefinitely.
Additionally, the stash is never popped automatically at the end of a
successful update, but the stash-pop message is printed if something is
stashed.
When an interrupt occurs, the original behavior is still in place
(switch back to the old branch and revision, and pop the stash), though
this could be changed as well.
This commit modifies the behavior of both `brew update` and
"update-bash.sh" in the manner described above.
The idea for this approach is from Mike McQuaid.
Issue Homebrew/homebrew#48812ClosesHomebrew/homebrew#48993.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Check to see if `HEAD` is the same as what we have locally. If it is:
don't bother to `git fetch`.
ClosesHomebrew/homebrew#47888.
ClosesHomebrew/homebrew#49219.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Also, rename the existing updater to `update-ruby` to allow using as
a fallback. It will eventually be removed.
ClosesHomebrew/homebrew#49109.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>