summaryrefslogtreecommitdiff
path: root/examples/network/fetch.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-10-23 14:22:44 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-10-23 14:22:44 +0200
commitebbd48f00e87eab699862f03a457571ead3c53b1 (patch)
tree43b8e4807b18a97ee3bbe9fc1131695a1b68c1de /examples/network/fetch.c
parent893055f22e5395ec95231b4cc8a19046a3eb5b4a (diff)
downloadlibgit2-ebbd48f00e87eab699862f03a457571ead3c53b1.tar.gz
examples: show used local objects in fetch
Show how many local objects were used to fix the thin pack in our fetch example.
Diffstat (limited to 'examples/network/fetch.c')
-rw-r--r--examples/network/fetch.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/network/fetch.c b/examples/network/fetch.c
index ce016ce0b..50ec0033a 100644
--- a/examples/network/fetch.c
+++ b/examples/network/fetch.c
@@ -125,8 +125,13 @@ int fetch(git_repository *repo, int argc, char **argv)
pthread_join(worker, NULL);
#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);
+ }
// Disconnect the underlying connection to prevent from idling.
git_remote_disconnect(remote);