aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2016-01-21 14:01:51 +0800
committerXu Cheng2016-01-21 21:14:55 +0800
commit58e02496090d45af7c95ad901a8e004620063b28 (patch)
tree0fc6c3c6dc94340efc5ab786de3b098c5b814a6f /Library
parentf7c276a0bee204af223e68a53af13c90674ea356 (diff)
downloadbrew-58e02496090d45af7c95ad901a8e004620063b28.tar.bz2
update-bash: don't stash for --simulate-from-current-branch
When invoking --simulate-from-current-branch, we shouldn't do any file manipulation.
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