Skip to content

Commit b724fee

Browse files
Address review comments
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz> Co-authored-by: Johan Mabille <johan.mabille@gmail.com>
1 parent 6ef5d64 commit b724fee

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/subcommand/fetch_subcommand.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ namespace
1313
{
1414
int sideband_progress(const char* str, int len, void*)
1515
{
16-
printf("remote: %.*s", len, str);
17-
fflush(stdout);
16+
std::cout << "remote: " << std::string(str, static_cast<std::size_t>(len));
17+
std::cout.flush();
1818
return 0;
1919
}
2020

2121
int fetch_progress(const git_indexer_progress* stats, void* payload)
2222
{
23-
static bool done = false;
23+
bool done = false;
2424

2525
auto* pr = reinterpret_cast<git_indexer_progress*>(payload);
2626
*pr = *stats;
@@ -60,13 +60,20 @@ namespace
6060

6161
if (git_oid_is_zero(a))
6262
{
63-
printf("[new] %.20s %s\n", b_str, refname);
63+
std::cout << "[new] "
64+
<< std::string(b_str, 20)
65+
<< " " << refname << std::endl;
6466
}
6567
else
6668
{
6769
git_oid_fmt(a_str, a);
6870
a_str[GIT_OID_SHA1_HEXSIZE] = '\0';
69-
printf("[updated] %.10s..%.10s %s\n", a_str, b_str, refname);
71+
72+
std::cout << "[updated] "
73+
<< std::string(a_str, 10)
74+
<< ".."
75+
<< std::string(b_str, 10)
76+
<< " " << refname << std::endl;
7077
}
7178

7279
return 0;

0 commit comments

Comments
 (0)