X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-fetch.sh;h=b46b3e558945a3afb783894c75ce20cede0b4eec;hb=e921fb82cf6fb4a5f138ec9d27bc37c658336a8c;hp=6586e773e6b3979463d5cc6537e6ddc5700de25a;hpb=583122cd1b37d12d6f9fb487302ae07f1b446f03;p=git.git diff --git a/git-fetch.sh b/git-fetch.sh index 6586e773..b46b3e55 100755 --- a/git-fetch.sh +++ b/git-fetch.sh @@ -1,6 +1,8 @@ #!/bin/sh # -. git-sh-setup || die "Not a git archive" + +USAGE=' ...' +. git-sh-setup . git-parse-remote _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" @@ -34,6 +36,9 @@ do -v|--verbose) verbose=Yes ;; + -*) + usage + ;; *) break ;; @@ -183,11 +188,20 @@ esac reflist=$(get_remote_refs_for_fetch "$@") if test "$tags" then - taglist=$(git-ls-remote --tags "$remote" | - sed -e ' - /\^/d - s/^[^ ]* // - s/.*/&:&/') + taglist=$(IFS=" " && + git-ls-remote --tags "$remote" | + while read sha1 name + do + case "$name" in + (*^*) continue ;; + esac + if git-check-ref-format "$name" + then + echo ".${name}:${name}" + else + echo >&2 "warning: tag ${name} ignored" + fi + done) if test "$#" -gt 1 then # remote URL plus explicit refspecs; we need to merge them.