Skip to content

Commit 28ba96a

Browse files
committed
clone: quell the progress report from init and report on clone
Currently, a local git clone reports only initializing an empty git dir, which is potentially confusing. Instead, report that cloning is in progress and when it is done (unless -q) is given, and suppress the init report. Signed-off-by: Michael J Gruber <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 64b9032 commit 28ba96a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

builtin/clone.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,8 @@ static const struct ref *clone_local(const char *src_repo,
302302
transport = transport_get(remote, src_repo);
303303
ret = transport_get_remote_refs(transport);
304304
transport_disconnect(transport);
305+
if (0 <= option_verbosity)
306+
printf("done.\n");
305307
return ret;
306308
}
307309

@@ -461,7 +463,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
461463
die("could not create leading directories of '%s'", git_dir);
462464
set_git_dir(make_absolute_path(git_dir));
463465

464-
init_db(option_template, (option_verbosity < 0) ? INIT_DB_QUIET : 0);
466+
if (0 <= option_verbosity)
467+
printf("Cloning into %s...\n", get_git_dir());
468+
init_db(option_template, INIT_DB_QUIET);
465469

466470
/*
467471
* At this point, the config exists, so we do not need the

t/t5601-clone.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test_expect_success 'clone with excess parameters (2)' '
3434
test_expect_success 'output from clone' '
3535
rm -fr dst &&
3636
git clone -n "file://$(pwd)/src" dst >output &&
37-
test $(grep Initialized output | wc -l) = 1
37+
test $(grep Clon output | wc -l) = 1
3838
'
3939

4040
test_expect_success 'clone does not keep pack' '

0 commit comments

Comments
 (0)