diff options
| author | Mike McQuaid | 2016-09-20 19:24:02 +0100 |
|---|---|---|
| committer | GitHub | 2016-09-20 19:24:02 +0100 |
| commit | bef4d135359373a9451d56631318481e0391bcb4 (patch) | |
| tree | a410cae569c70814409727b04a8b39db58729e44 /Library | |
| parent | 71cffef62540972dd2c5b755541c192fd8d50e96 (diff) | |
| parent | 96232722839e54ce4cdaf3dc87f976542795eced (diff) | |
| download | brew-bef4d135359373a9451d56631318481e0391bcb4.tar.bz2 | |
Merge pull request #1046 from MikeMcQuaid/update-tags
Update: ensure tags are fetched
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/update.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index b57691893..acf4520ba 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -425,6 +425,12 @@ EOS declare UPSTREAM_BRANCH"$TAP_VAR"="$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" ]] then [[ -n "$SKIP_FETCH_BREW_REPOSITORY" && "$DIR" = "$HOMEBREW_REPOSITORY" ]] && continue @@ -480,10 +486,10 @@ EOS if [[ -n "$HOMEBREW_UPDATE_PREINSTALL" ]] 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 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" then echo "Fetching $DIR failed!" >>"$update_failed_file" |
