diff options
| author | Mike McQuaid | 2016-09-08 09:06:41 +0100 |
|---|---|---|
| committer | GitHub | 2016-09-08 09:06:41 +0100 |
| commit | 12813b8b627829176d7d1b4260ba038ada705e93 (patch) | |
| tree | 072c313dc42e0d0cd7baa61e7702fa2949658189 /Library | |
| parent | 9586390418dbcb8655bf7c62bb315c2a2090722e (diff) | |
| parent | 37beacd37d76a069c3819d5c67e07d15a9934069 (diff) | |
| download | brew-12813b8b627829176d7d1b4260ba038ada705e93.tar.bz2 | |
Merge pull request #879 from penman/checkout_warning
Warn when changing branch on update
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/update.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index c0658aa4c..ed51444c5 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -242,6 +242,14 @@ 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 + echo "Checking out $UPSTREAM_BRANCH in $DIR..." + echo "To checkout $INITIAL_BRANCH in $DIR run:" + echo " 'cd $DIR && git checkout $INITIAL_BRANCH" + 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 |
