aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAlyssa Ross2016-09-05 11:20:19 +0100
committerAlyssa Ross2016-09-05 11:20:19 +0100
commit07a00c234c2f0ed3387fc6508c2da21866f1e222 (patch)
treecdf2fc48e7140f03611a95f56c86d644055e9d4c /Library
parent2498d99a143d0e50e92a0aa60316d47c9ea83edc (diff)
downloadbrew-07a00c234c2f0ed3387fc6508c2da21866f1e222.tar.bz2
Warn when changing branch on update
Closes #877
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/update.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh
index c0658aa4c..9a9567101 100644
--- a/Library/Homebrew/cmd/update.sh
+++ b/Library/Homebrew/cmd/update.sh
@@ -242,6 +242,15 @@ EOS
INITIAL_BRANCH="$(git symbolic-ref --short HEAD 2>/dev/null)"
if [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]]
then
+
+ if [[ -z "$HOMEBREW_DEVELOPER" ]]
+ then
+ opoo <<EOS
+Checking out $UPSTREAM_BRANCH.
+Set HOMEBREW_DEVELOPER=1 to preserve branch when updating Homebrew.
+EOS
+ fi
+
# Recreate and check out `#{upstream_branch}` if unable to fast-forward
# it to `origin/#{@upstream_branch}`. Otherwise, just check it out.
if git merge-base --is-ancestor "$UPSTREAM_BRANCH" "origin/$UPSTREAM_BRANCH" &>/dev/null