Skip to content

Commit bfa9148

Browse files
avargitster
authored andcommitted
remote: add camel-cased *.tagOpt key, like clone
Change "git remote add" so that it adds a *.tagOpt key, and not the lower-cased *.tagopt on "git remote add --no-tags", just as "git clone --no-tags" would do. This doesn't matter for anything that reads the config. It's just prettier if we write config keys in their documented camelCase form to user-readable config files. When I added support for "clone -no-tags" in 0dab246 (clone: add a --no-tags option to clone without tags, 2017-04-26) I made it use the *.tagOpt form, but the older "git remote add" added in 111fb85 (remote add: add a --[no-]tags option, 2010-04-20) has been using *.tagopt all this time. It's easy enough to add a test for this, so let's do that. We can't use "git config -l" there, because it'll normalize the keys to their lower-cased form. Let's add the test for "git clone" too for good measure, not just to the "git remote" codepath we're fixing. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 59ec224 commit bfa9148

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

builtin/remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static int add(int argc, const char **argv)
221221

222222
if (fetch_tags != TAGS_DEFAULT) {
223223
strbuf_reset(&buf);
224-
strbuf_addf(&buf, "remote.%s.tagopt", name);
224+
strbuf_addf(&buf, "remote.%s.tagOpt", name);
225225
git_config_set(buf.buf,
226226
fetch_tags == TAGS_SET ? "--tags" : "--no-tags");
227227
}

t/t5505-remote.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,7 @@ test_expect_success 'add --no-tags' '
591591
cd add-no-tags &&
592592
git init &&
593593
git remote add -f --no-tags origin ../one &&
594+
grep tagOpt .git/config &&
594595
git tag -l some-tag >../test/output &&
595596
git tag -l foobar-tag >../test/output &&
596597
git config remote.origin.tagopt >>../test/output

t/t5612-clone-refspec.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ test_expect_success 'by default no tags will be kept updated' '
9494
test_expect_success 'clone with --no-tags' '
9595
(
9696
cd dir_all_no_tags &&
97+
grep tagOpt .git/config &&
9798
git fetch &&
9899
git for-each-ref refs/tags >../actual
99100
) &&

0 commit comments

Comments
 (0)