update: tweak stash/checkout behavior. (#312)
Always pop stashed changes for Homebrew developers and only checkout original branches for them (to avoid users who don't understand Git ending up "stuck" on branches).
This commit is contained in:
parent
5e272257d2
commit
8a217dd420
@ -124,7 +124,7 @@ reset_on_interrupt() {
|
|||||||
git reset --hard "$INITIAL_REVISION" "${QUIET_ARGS[@]}"
|
git reset --hard "$INITIAL_REVISION" "${QUIET_ARGS[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]]
|
if [[ -n "$HOMEBREW_DEVELOPER" ]]
|
||||||
then
|
then
|
||||||
pop_stash
|
pop_stash
|
||||||
else
|
else
|
||||||
@ -225,10 +225,13 @@ pull() {
|
|||||||
|
|
||||||
trap '' SIGINT
|
trap '' SIGINT
|
||||||
|
|
||||||
if [[ -n "$HOMEBREW_DEVELOPER" ]] &&
|
if [[ -n "$HOMEBREW_DEVELOPER" ]]
|
||||||
[[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]]
|
|
||||||
then
|
then
|
||||||
git checkout "${QUIET_ARGS[@]}" "$INITIAL_BRANCH"
|
if [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]]
|
||||||
|
then
|
||||||
|
git checkout "$INITIAL_BRANCH"
|
||||||
|
fi
|
||||||
|
|
||||||
pop_stash
|
pop_stash
|
||||||
else
|
else
|
||||||
pop_stash_message
|
pop_stash_message
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user