Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 2856cbf

Browse files
peffgitster
authored andcommitted
clone: treat "checking connectivity" like other progress
When stderr does not point to a tty, we typically suppress "we are now in this phase" progress reporting (e.g., we ask the server not to send us "counting objects" and the like). The new "checking connectivity" message is in the same vein, and should be suppressed. Since clone relies on the transport code to make the decision, we can simply sneak a peek at the "progress" field of the transport struct. That properly takes into account both the verbosity and progress options we were given, as well as the result of isatty(). Note that we do not set up that progress flag for a local clone, as we do not fetch using the transport at all. That's acceptable here, though, because we also do not perform a connectivity check in that case. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 68b939b commit 2856cbf

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

builtin/clone.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,12 +551,12 @@ static void update_remote_refs(const struct ref *refs,
551551
const struct ref *rm = mapped_refs;
552552

553553
if (check_connectivity) {
554-
if (0 <= option_verbosity)
554+
if (transport->progress)
555555
fprintf(stderr, _("Checking connectivity... "));
556556
if (check_everything_connected_with_transport(iterate_ref_map,
557557
0, &rm, transport))
558558
die(_("remote did not send all necessary objects"));
559-
if (0 <= option_verbosity)
559+
if (transport->progress)
560560
fprintf(stderr, _("done\n"));
561561
}
562562

t/t5702-clone-options.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ test_expect_success 'clone -o' '
2222
test_expect_success 'redirected clone does not show progress' '
2323
2424
git clone "file://$(pwd)/parent" clone-redirected >out 2>err &&
25-
! grep % err
25+
! grep % err &&
26+
test_i18ngrep ! "Checking connectivity" err
2627
2728
'
2829

0 commit comments

Comments
 (0)