diff options
| author | Mike McQuaid | 2016-09-21 15:54:10 +0100 |
|---|---|---|
| committer | GitHub | 2016-09-21 15:54:10 +0100 |
| commit | a381b597d3ebf40887b50657df269d867a209eb7 (patch) | |
| tree | 5d7e9dad76b1becf207fcc41c9ace4021177b2b0 | |
| parent | 09e0b097a42ff8417f45b511fa125a64c127479a (diff) | |
| parent | f9bd121e387dfa478b924d1a28a439ae2318cafe (diff) | |
| download | brew-1.0.1.tar.bz2 | |
Merge pull request #1060 from MikeMcQuaid/update-tag-tweaks1.0.1
update.sh: tweak tag handling.
| -rw-r--r-- | Library/Homebrew/cmd/update.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index eb15e1029..a043853d8 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -218,6 +218,8 @@ merge_or_rebase() { if [[ "$DIR" = "$HOMEBREW_REPOSITORY" && -z "$HOMEBREW_NO_UPDATE_CLEANUP" ]] then UPSTREAM_TAG="$(git tag --list --sort=-version:refname | head -n1)" + else + UPSTREAM_TAG="" fi if [ -n "$UPSTREAM_TAG" ] @@ -253,7 +255,8 @@ EOS fi INITIAL_BRANCH="$(git symbolic-ref --short HEAD 2>/dev/null)" - if [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]] + if [[ -n "$UPSTREAM_TAG" ]] || + [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]] then if [[ -z "$HOMEBREW_NO_UPDATE_CLEANUP" ]] @@ -265,7 +268,8 @@ EOS # 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" "$REMOTE_REF" &>/dev/null + if [[ -z "$UPSTREAM_TAG" ]] && + git merge-base --is-ancestor "$UPSTREAM_BRANCH" "$REMOTE_REF" &>/dev/null then git checkout --force "$UPSTREAM_BRANCH" "${QUIET_ARGS[@]}" else |
