git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] bundle: Fix "verify" output if history is complete

From
LFLukas Fleischer <git@cryptocrack.de>
Date
Mar 7, 2013, 00:56 UTC
Message-ID
<1362617796-4120-1-git-send-email-git@cryptocrack.de>

A more informative message for "complete" bundles was added in commit 8c3710fd. However, the prerequisites ref list is currently read *after* we check if it equals zero, which means we never actually print the newly introduced message.

Move the code that reads the prerequisites ref list before the check to fix this.

Signed-off-by: Lukas Fleischer <git@cryptocrack.de>
---
I am not sure whether we should add a test case for such a simple "bug".
If you think we should, just let me know and I will add one.
 bundle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
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),
-- 
1.8.2.rc2.352.g908df73
Next: Lukas Fleischer
Message 1 of 4 in “bundle: Fix "verify" output if history is complete”
  1. 1/2 bundle: Fix "verify" output if history is completeLukas Fleischer, Mar 7, 2013
  2. 2/2 bundle: Add colons to list headings in "verify"Lukas Fleischer, Mar 7, 2013
  3. Junio C HamanoMar 7, 2013
  4. bundle: Add colons to list headings in "verify"Lukas Fleischer, Mar 8, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.