aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Homebrew/cmd/update-bash.sh32
1 files changed, 16 insertions, 16 deletions
diff --git a/Library/Homebrew/cmd/update-bash.sh b/Library/Homebrew/cmd/update-bash.sh
index 856ac1e5c..e72f3f196 100755
--- a/Library/Homebrew/cmd/update-bash.sh
+++ b/Library/Homebrew/cmd/update-bash.sh
@@ -155,22 +155,6 @@ pull() {
INITIAL_BRANCH="$(git symbolic-ref --short HEAD 2>/dev/null)"
UPSTREAM_BRANCH="$(upstream_branch)"
- trap reset_on_interrupt SIGINT
-
- if [[ -n "$(git status --untracked-files=all --porcelain 2>/dev/null)" ]]
- then
- if [[ -n "$HOMEBREW_VERBOSE" ]]
- then
- echo "Stashing uncommitted changes to $DIR."
- git status --short --untracked-files=all
- fi
- git -c "user.email=brew-update@localhost" \
- -c "user.name=brew update" \
- stash save --include-untracked $QUIET_ARGS
- git reset --hard $QUIET_ARGS
- STASHED="1"
- fi
-
# Used for testing purposes, e.g., for testing formula migration after
# renaming it in the currently checked-out branch. To test run
# "brew update --simulate-from-current-branch"
@@ -187,6 +171,22 @@ pull() {
return
fi
+ trap reset_on_interrupt SIGINT
+
+ if [[ -n "$(git status --untracked-files=all --porcelain 2>/dev/null)" ]]
+ then
+ if [[ -n "$HOMEBREW_VERBOSE" ]]
+ then
+ echo "Stashing uncommitted changes to $DIR."
+ git status --short --untracked-files=all
+ fi
+ git -c "user.email=brew-update@localhost" \
+ -c "user.name=brew update" \
+ stash save --include-untracked $QUIET_ARGS
+ git reset --hard $QUIET_ARGS
+ STASHED="1"
+ fi
+
if [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]]
then
# Recreate and check out `#{upstream_branch}` if unable to fast-forward