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:
Mike McQuaid 2016-06-03 14:12:36 +01:00 committed by GitHub
parent 5e272257d2
commit 8a217dd420

View File

@ -124,7 +124,7 @@ reset_on_interrupt() {
git reset --hard "$INITIAL_REVISION" "${QUIET_ARGS[@]}"
fi
if [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]]
if [[ -n "$HOMEBREW_DEVELOPER" ]]
then
pop_stash
else
@ -225,10 +225,13 @@ pull() {
trap '' SIGINT
if [[ -n "$HOMEBREW_DEVELOPER" ]] &&
[[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]]
if [[ -n "$HOMEBREW_DEVELOPER" ]]
then
git checkout "${QUIET_ARGS[@]}" "$INITIAL_BRANCH"
if [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]]
then
git checkout "$INITIAL_BRANCH"
fi
pop_stash
else
pop_stash_message