Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review comments
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>

Co-authored-by: Johan Mabille <johan.mabille@gmail.com>
  • Loading branch information
2 people authored and SandrineP committed Dec 10, 2025
commit 72404c28b19ddb36198832ae3a9a726d5608f1b5
17 changes: 12 additions & 5 deletions src/subcommand/fetch_subcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ namespace
{
int sideband_progress(const char* str, int len, void*)
{
printf("remote: %.*s", len, str);
fflush(stdout);
std::cout << "remote: " << std::string(str, static_cast<std::size_t>(len));
std::cout.flush();
return 0;
}

int fetch_progress(const git_indexer_progress* stats, void* payload)
{
static bool done = false;
bool done = false;

auto* pr = reinterpret_cast<git_indexer_progress*>(payload);
*pr = *stats;
Expand Down Expand Up @@ -60,13 +60,20 @@ namespace

if (git_oid_is_zero(a))
{
printf("[new] %.20s %s\n", b_str, refname);
std::cout << "[new] "
<< std::string(b_str, 20)
<< " " << refname << std::endl;
}
else
{
git_oid_fmt(a_str, a);
a_str[GIT_OID_SHA1_HEXSIZE] = '\0';
printf("[updated] %.10s..%.10s %s\n", a_str, b_str, refname);

std::cout << "[updated] "
<< std::string(a_str, 10)
<< ".."
<< std::string(b_str, 10)
<< " " << refname << std::endl;
}

return 0;
Expand Down