mirror of
https://github.com/git/git
synced 2024-09-17 23:41:33 +00:00
"git-fetch --tags $URL" should not overwrite existing tags
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>
This commit is contained in:
parent
acb39f64c6
commit
85b1f98871
15
git-fetch.sh
15
git-fetch.sh
|
@ -253,23 +253,10 @@ if test "$tags"
|
||||||
then
|
then
|
||||||
taglist=`IFS=' ' &&
|
taglist=`IFS=' ' &&
|
||||||
echo "$ls_remote_result" |
|
echo "$ls_remote_result" |
|
||||||
|
git-show-ref --exclude-existing=refs/tags/ |
|
||||||
while read sha1 name
|
while read sha1 name
|
||||||
do
|
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}"
|
echo ".${name}:${name}"
|
||||||
else
|
|
||||||
echo >&2 "warning: tag ${name} ignored"
|
|
||||||
fi
|
|
||||||
done` || exit
|
done` || exit
|
||||||
if test "$#" -gt 1
|
if test "$#" -gt 1
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in a new issue