From 71ba6b10f81ac8afcb0ba376f6691afe1269467c Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 7 Mar 2013 01:56:35 +0100 Subject: bundle: Fix "verify" output if history is complete A more informative message for "complete" bundles was added in commit 8c3710fd3011 (tweak "bundle verify" of a complete history, 2012-06-04). However, the prerequisites ref list is currently read *after* we check if it equals zero, which means we never actually use the number of prerequisite refs to decide when to print the newly introduced message. The code incorrectly uses the number of references recorded in the bundle instead. Signed-off-by: Lukas Fleischer Signed-off-by: Junio C Hamano diff --git a/bundle.c b/bundle.c index 8d12816..65db53b 100644 --- a/bundle.c +++ b/bundle.c @@ -188,10 +188,10 @@ int verify_bundle(struct bundle_header *header, int verbose) r->nr), r->nr); list_refs(r, 0, NULL); + r = &header->prerequisites; if (!r->nr) { printf_ln(_("The bundle records a complete history.")); } else { - r = &header->prerequisites; printf_ln(Q_("The bundle requires this ref", "The bundle requires these %d refs", r->nr), -- cgit v0.10.2-6-g49f6 From a02ffe0e1a19c9594af3e81f4e04b46eabe4755a Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 8 Mar 2013 19:01:26 +0100 Subject: bundle: Add colons to list headings in "verify" These slightly improve the reading flow by making it obvious that a list follows. Also, make the wording of both headings consistent by changing "contains %d ref(s)" to "contains this ref"/"contains these %d refs". Signed-off-by: Lukas Fleischer Signed-off-by: Junio C Hamano diff --git a/bundle.c b/bundle.c index 65db53b..6210a6b 100644 --- a/bundle.c +++ b/bundle.c @@ -183,8 +183,8 @@ int verify_bundle(struct bundle_header *header, int verbose) struct ref_list *r; r = &header->references; - printf_ln(Q_("The bundle contains %d ref", - "The bundle contains %d refs", + printf_ln(Q_("The bundle contains this ref:", + "The bundle contains these %d refs:", r->nr), r->nr); list_refs(r, 0, NULL); @@ -192,8 +192,8 @@ int verify_bundle(struct bundle_header *header, int verbose) if (!r->nr) { printf_ln(_("The bundle records a complete history.")); } else { - printf_ln(Q_("The bundle requires this ref", - "The bundle requires these %d refs", + printf_ln(Q_("The bundle requires this ref:", + "The bundle requires these %d refs:", r->nr), r->nr); list_refs(r, 0, NULL); -- cgit v0.10.2-6-g49f6