fetch: no FETCH_HEAD display if --no-write-fetch-head
authorJonathan Tan <jonathantanmy@google.com>
Wed, 2 Sep 2020 21:05:39 +0000 (14:05 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Sep 2020 21:26:55 +0000 (14:26 -0700)
commitdb3c293ecded67128b74a03f01e65c6799ff1116
tree6f6c6767953c0699421711dfe40867a54ce7971c
parent9dfa8dbeee18a126aabcdd36a06e5d6b5eb6a58a
fetch: no FETCH_HEAD display if --no-write-fetch-head

887952b8c6 ("fetch: optionally allow disabling FETCH_HEAD update",
2020-08-18) introduced the ability to disable writing to FETCH_HEAD
during fetch, but did not suppress the "<source> -> FETCH_HEAD" message
when this ability is used. This message is misleading in this case,
because FETCH_HEAD is not written. Also, because "fetch" is used to
lazy-fetch missing objects in a partial clone, this significantly
clutters up the output in that case since the objects to be fetched are
potentially numerous.

Therefore, suppress this message when --no-write-fetch-head is passed
(but not when --dry-run is set).

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c
t/t0410-partial-clone.sh
t/t5510-fetch.sh