Skip to content

Commit

Permalink
"git-fetch --tags $URL" should not overwrite existing tags
Browse files Browse the repository at this point in the history
Use the same --exclude-existing filter as we use for automatic
tag following to avoid overwriting existing tags with replacement
ones the other side created.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Feb 13, 2007
1 parent acb39f6 commit 85b1f98
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions git-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -253,23 +253,10 @@ if test "$tags"
then
taglist=`IFS=' ' &&
echo "$ls_remote_result" |
git-show-ref --exclude-existing=refs/tags/ |
while read sha1 name
do
case "$sha1" in
fail)
exit 1
esac
case "$name" in
*^*) continue ;;
refs/tags/*) ;;
*) continue ;;
esac
if git-check-ref-format "$name"
then
echo ".${name}:${name}"
else
echo >&2 "warning: tag ${name} ignored"
fi
echo ".${name}:${name}"
done` || exit
if test "$#" -gt 1
then
Expand Down

0 comments on commit 85b1f98

Please sign in to comment.