fetch tests: fetch <url> <spec> as well as fetch [<remote>]
commite1790f9245f120940be9333b09015e04a8e73127
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Fri, 9 Feb 2018 20:32:10 +0000 (9 20:32 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 9 Feb 2018 21:10:12 +0000 (9 13:10 -0800)
treecd54ddcd3746eddb857c2e509388afb53e6c5508
parent59caf52d094494a8c02dd7f15302891678533182
fetch tests: fetch <url> <spec> as well as fetch [<remote>]

When a remote URL is supplied on the command-line the internals of the
fetch are different, in particular the code in get_ref_map(). An
earlier version of the subsequent fetch.pruneTags patch hid a segfault
because the difference wasn't tested for.

Now all the tests are run as both of the variants of:

    git fetch
    git -c [...] fetch $(git config remote.origin.url) $(git config remote.origin.fetch)

I'm using -c because while the [fetch] config just set by
set_config_tristate will be picked up, the remote.origin.* config
won't override it as intended.

Work around that and turn this into a purely command-line test by
always setting the variables on the command-line, and translate any
setting of remote.origin.X into fetch.X.

The reason for choosing the names "name" and "link" as opposed to
e.g. "named" and "url" is because they're the same length, which makes
the test output easier to read as it will be aligned.

Due to shellscript quoting madness it's not worthwhile to do all of
this within a test_expect_success, but do the parts that can easily be
done there, including the one-time setting of variables that don't
change between runs to be used by subsequent runs in the 'prune_type
setup' test.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5510-fetch.sh