mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-06 14:46:04 +00:00
examples: show used local objects in fetch
Show how many local objects were used to fix the thin pack in our fetch example.
This commit is contained in:
parent
893055f22e
commit
ebbd48f00e
@ -125,8 +125,13 @@ int fetch(git_repository *repo, int argc, char **argv)
|
|||||||
pthread_join(worker, NULL);
|
pthread_join(worker, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
printf("\rReceived %d/%d objects in %zu bytes\n",
|
if (stats->local_objects > 0) {
|
||||||
|
printf("\rReceived %d/%d objects in %zu bytes (used %d local objects)\n",
|
||||||
|
stats->indexed_objects, stats->total_objects, stats->received_bytes, stats->local_objects);
|
||||||
|
} else{
|
||||||
|
printf("\rReceived %d/%d objects in %zu bytes\n",
|
||||||
stats->indexed_objects, stats->total_objects, stats->received_bytes);
|
stats->indexed_objects, stats->total_objects, stats->received_bytes);
|
||||||
|
}
|
||||||
|
|
||||||
// Disconnect the underlying connection to prevent from idling.
|
// Disconnect the underlying connection to prevent from idling.
|
||||||
git_remote_disconnect(remote);
|
git_remote_disconnect(remote);
|
||||||
|
Loading…
Reference in New Issue
Block a user