aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2016-06-03 14:12:36 +0100
committerGitHub2016-06-03 14:12:36 +0100
commit8a217dd42088b295e809d38d4b37f3c8bd47e8cf (patch)
tree436f733cc285dca599569e8916579aa49b765ea6
parent5e272257d288d751d936624767d4613dde7ff452 (diff)
downloadbrew-8a217dd42088b295e809d38d4b37f3c8bd47e8cf.tar.bz2
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).
-rw-r--r--Library/Homebrew/cmd/update.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh
index e1ba579ee..54f4f9517 100644
--- a/Library/Homebrew/cmd/update.sh
+++ b/Library/Homebrew/cmd/update.sh
@@ -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