@matheusbsbs / matheus-bagliano / commits / 944163a4bd
Fork 0

Honor "tagopt = --tags" configuration option

If the "tagopt = --tags" option of a remote is set, all tags will be fetched as in "git fetch --tags". Signed-off-by: Samuel Tardieu <sam@rfc1149.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Samuel Tardieu committed Apr 20, 2010 at 01:31 UTC 944163a4bd4cc4c35392147d10020ba57c6d7d87
3 files changed +8 -2
Documentation/config.txt
+3 -1
@@ -1578,7 +1578,9 @@ remote.<name>.uploadpack::
1578
1579 remote.<name>.tagopt::
1580 Setting this value to \--no-tags disables automatic tag following when
1581 - fetching from remote <name>
1581 + fetching from remote <name>. Setting it to \--tags will fetch every
1582 + tag from remote <name>, even if they are not reachable from remote
1583 + branch heads.
1584
1585 remote.<name>.vcs::
1586 Setting this to a value <vcs> will cause git to interact with
contrib/examples/git-fetch.sh
+3 -1
@@ -127,10 +127,12 @@ then
127 orig_head=$(git rev-parse --verify HEAD 2>/dev/null)
128 fi
129
130 -# Allow --notags from remote.$1.tagopt
130 +# Allow --tags/--notags from remote.$1.tagopt
131 case "$tags$no_tags" in
132 '')
133 case "$(git config --get "remote.$1.tagopt")" in
134 + --tags)
135 + tags=t ;;
136 --no-tags)
137 no_tags=t ;;
138 esac
remote.c
+2
@@ -443,6 +443,8 @@ static int handle_config(const char *key, const char *value, void *cb)
443 } else if (!strcmp(subkey, ".tagopt")) {
444 if (!strcmp(value, "--no-tags"))
445 remote->fetch_tags = -1;
446 + else if (!strcmp(value, "--tags"))
447 + remote->fetch_tags = 2;
448 } else if (!strcmp(subkey, ".proxy")) {
449 return git_config_string((const char **)&remote->http_proxy,
450 key, value);