You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
remoteTags=$(cd "$repo"&& remoteTagsSorted "$remote" -r)|| (logInfo >&2"check your internet connection"&&return 1) ||return$?
121
-
grep "$tagToFetch"<<<"$remoteTags">/dev/null || returnDying "remote \033[0;36m%s\033[0m does not have the tag \033[0;36m%s\033[0m\nFollowing the available tags:\n%s""$remote""$tagToFetch""$remoteTags"||return$?
122
-
git -C "$repo" fetch --depth 1 "$remote""refs/tags/$tagToFetch:refs/tags/$tagToFetch"|| returnDying "was not able to fetch tag %s from remote %s""$tagToFetch""$remote"||return$?
123
-
fi
108
+
functiongitFetchTagFromRemote(){
109
+
local remote repo tagToFetch
110
+
# shellcheck disable=SC2034 # is passed by name to parseFnArgs
111
+
local -ra params=(remote repo tagToFetch)
112
+
parseFnArgs params "$@"
113
+
114
+
local tags
115
+
tags=$(git -C "$repo" tag)|| die "The following command failed (see above): git tag"
remoteTags=$(cd "$repo"&& remoteTagsSorted "$remote" -r)|| (logInfo >&2"check your internet connection"&&return 1) ||return$?
121
+
grep "$tagToFetch"<<<"$remoteTags">/dev/null || returnDying "remote \033[0;36m%s\033[0m does not have the tag \033[0;36m%s\033[0m\nFollowing the available tags:\n%s""$remote""$tagToFetch""$remoteTags"||return$?
122
+
git -C "$repo" fetch --depth 1 "$remote""refs/tags/$tagToFetch:refs/tags/$tagToFetch"|| returnDying "was not able to fetch tag %s from remote %s""$tagToFetch""$remote"||return$?
0 commit comments