Skip to content

Commit

Permalink
git-fetch --tags: reject malformed tags.
Browse files Browse the repository at this point in the history
When the other end was prepared with older git and has tags that
do not follow the naming convention (see check-ref-format), do not
barf but simply reject to copy them.

Initial fix by Simon Richter, but done differently.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Jan 6, 2006
1 parent 353ce81 commit 81214e4
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions git-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,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.
Expand Down

0 comments on commit 81214e4

Please sign in to comment.