update.sh: use HOMEBREW_UPDATE_TO_TAG.
This makes the code easier to follow rather than having to know HOMEBREW_NO_UPDATE_CLEANUP implies not updating to a tag.
This commit is contained in:
parent
6e5735565b
commit
1ff2d06cf0
@ -215,7 +215,7 @@ merge_or_rebase() {
|
|||||||
|
|
||||||
trap reset_on_interrupt SIGINT
|
trap reset_on_interrupt SIGINT
|
||||||
|
|
||||||
if [[ "$DIR" = "$HOMEBREW_REPOSITORY" && -z "$HOMEBREW_NO_UPDATE_CLEANUP" ]]
|
if [[ "$DIR" = "$HOMEBREW_REPOSITORY" && -n "$HOMEBREW_UPDATE_TO_TAG" ]]
|
||||||
then
|
then
|
||||||
UPSTREAM_TAG="$(git tag --list --sort=-version:refname |
|
UPSTREAM_TAG="$(git tag --list --sort=-version:refname |
|
||||||
grep --max-count=1 '^[0-9]*\.[0-9]*\.[0-9]*$')"
|
grep --max-count=1 '^[0-9]*\.[0-9]*\.[0-9]*$')"
|
||||||
@ -351,6 +351,8 @@ EOS
|
|||||||
if [[ -n "$HOMEBREW_DEVELOPER" || -n "$HOMEBREW_DEV_CMD_RUN" ]]
|
if [[ -n "$HOMEBREW_DEVELOPER" || -n "$HOMEBREW_DEV_CMD_RUN" ]]
|
||||||
then
|
then
|
||||||
export HOMEBREW_NO_UPDATE_CLEANUP="1"
|
export HOMEBREW_NO_UPDATE_CLEANUP="1"
|
||||||
|
else
|
||||||
|
export HOMEBREW_UPDATE_TO_TAG="1"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -471,7 +473,7 @@ EOS
|
|||||||
UPSTREAM_REPOSITORY="${UPSTREAM_REPOSITORY_URL#https://github.com/}"
|
UPSTREAM_REPOSITORY="${UPSTREAM_REPOSITORY_URL#https://github.com/}"
|
||||||
UPSTREAM_REPOSITORY="${UPSTREAM_REPOSITORY%.git}"
|
UPSTREAM_REPOSITORY="${UPSTREAM_REPOSITORY%.git}"
|
||||||
|
|
||||||
if [[ "$DIR" = "$HOMEBREW_REPOSITORY" && -z "$HOMEBREW_NO_UPDATE_CLEANUP" ]]
|
if [[ "$DIR" = "$HOMEBREW_REPOSITORY" && -n "$HOMEBREW_UPDATE_TO_TAG" ]]
|
||||||
then
|
then
|
||||||
# Only try to `git fetch` when the upstream tags have changed
|
# Only try to `git fetch` when the upstream tags have changed
|
||||||
# (so the API does not return 304: unmodified).
|
# (so the API does not return 304: unmodified).
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user