git-fetch: follow tag only when tracking remote branch.
Unless --no-tags flag was given, git-fetch tried to always follow remote tags that point at the commits we picked up. It is not very useful to pick up tags from remote unless storing the fetched branch head in a local tracking branch. This is especially true if the fetch is done to merge the remote branch into our current branch as one-shot basis (i.e. "please pull"), and is even harmful if the remote repository has many irrelevant tags. This proposed update disables the automated tag following unless we are storing the a fetched branch head in a local tracking branch. Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
183bdb2ccc
commit
6dc78e696b
@ -368,6 +368,10 @@ fetch_main "$reflist"
|
||||
# automated tag following
|
||||
case "$no_tags$tags" in
|
||||
'')
|
||||
case "$reflist" in
|
||||
*:refs/*)
|
||||
# effective only when we are following remote branch
|
||||
# using local tracking branch.
|
||||
taglist=$(IFS=" " &&
|
||||
git-ls-remote $upload_pack --tags "$remote" |
|
||||
sed -ne 's|^\([0-9a-f]*\)[ ]\(refs/tags/.*\)^{}$|\1 \2|p' |
|
||||
@ -382,6 +386,7 @@ case "$no_tags$tags" in
|
||||
echo >&2 "Auto-following $name"
|
||||
echo ".${name}:${name}"
|
||||
done)
|
||||
esac
|
||||
case "$taglist" in
|
||||
'') ;;
|
||||
?*)
|
||||
|
Loading…
Reference in New Issue
Block a user