Merge pull request #1046 from MikeMcQuaid/update-tags

Update: ensure tags are fetched
This commit is contained in:
Mike McQuaid 2016-09-20 19:24:02 +01:00 committed by GitHub
commit bef4d13535

View File

@ -425,6 +425,12 @@ EOS
declare UPSTREAM_BRANCH"$TAP_VAR"="$UPSTREAM_BRANCH_DIR" declare UPSTREAM_BRANCH"$TAP_VAR"="$UPSTREAM_BRANCH_DIR"
declare PREFETCH_REVISION"$TAP_VAR"="$(git rev-parse -q --verify refs/remotes/origin/"$UPSTREAM_BRANCH_DIR")" declare PREFETCH_REVISION"$TAP_VAR"="$(git rev-parse -q --verify refs/remotes/origin/"$UPSTREAM_BRANCH_DIR")"
# Force a full update if we don't have any tags.
if [[ "$DIR" = "$HOMEBREW_REPOSITORY" && -z "$(git tag --list)" ]]
then
HOMEBREW_UPDATE_FORCE=1
fi
if [[ -z "$HOMEBREW_UPDATE_FORCE" ]] if [[ -z "$HOMEBREW_UPDATE_FORCE" ]]
then then
[[ -n "$SKIP_FETCH_BREW_REPOSITORY" && "$DIR" = "$HOMEBREW_REPOSITORY" ]] && continue [[ -n "$SKIP_FETCH_BREW_REPOSITORY" && "$DIR" = "$HOMEBREW_REPOSITORY" ]] && continue
@ -480,10 +486,10 @@ EOS
if [[ -n "$HOMEBREW_UPDATE_PREINSTALL" ]] if [[ -n "$HOMEBREW_UPDATE_PREINSTALL" ]]
then then
git fetch --force "${QUIET_ARGS[@]}" origin \ git fetch --tags --force "${QUIET_ARGS[@]}" origin \
"refs/heads/$UPSTREAM_BRANCH_DIR:refs/remotes/origin/$UPSTREAM_BRANCH_DIR" 2>/dev/null "refs/heads/$UPSTREAM_BRANCH_DIR:refs/remotes/origin/$UPSTREAM_BRANCH_DIR" 2>/dev/null
else else
if ! git fetch --force "${QUIET_ARGS[@]}" origin \ if ! git fetch --tags --force "${QUIET_ARGS[@]}" origin \
"refs/heads/$UPSTREAM_BRANCH_DIR:refs/remotes/origin/$UPSTREAM_BRANCH_DIR" "refs/heads/$UPSTREAM_BRANCH_DIR:refs/remotes/origin/$UPSTREAM_BRANCH_DIR"
then then
echo "Fetching $DIR failed!" >>"$update_failed_file" echo "Fetching $DIR failed!" >>"$update_failed_file"