Skip to content

Commit

Permalink
clone: quell the progress report from init and report on clone
Browse files Browse the repository at this point in the history
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 <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed May 4, 2010
1 parent 64b9032 commit 28ba96a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion builtin/clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ static const struct ref *clone_local(const char *src_repo,
transport = transport_get(remote, src_repo);
ret = transport_get_remote_refs(transport);
transport_disconnect(transport);
if (0 <= option_verbosity)
printf("done.\n");
return ret;
}

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

init_db(option_template, (option_verbosity < 0) ? INIT_DB_QUIET : 0);
if (0 <= option_verbosity)
printf("Cloning into %s...\n", get_git_dir());
init_db(option_template, INIT_DB_QUIET);

/*
* At this point, the config exists, so we do not need the
Expand Down
2 changes: 1 addition & 1 deletion t/t5601-clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test_expect_success 'clone with excess parameters (2)' '
test_expect_success 'output from clone' '
rm -fr dst &&
git clone -n "file://$(pwd)/src" dst >output &&
test $(grep Initialized output | wc -l) = 1
test $(grep Clon output | wc -l) = 1
'

test_expect_success 'clone does not keep pack' '
Expand Down

0 comments on commit 28ba96a

Please sign in to comment.