Skip to content

Commit 8c3710f

Browse files
committed
tweak "bundle verify" of a complete history
A bundle that records a complete history without prerequiste is a useful way to sneakernet the sources of your configuration files under your home directory, etc. E.g. $ GIT_DIR=/srv/git/homesrc.git git bundle create x.bndl HEAD master Running "git bundle verify" on such a "complete" bundle, however, gives somewhat a funny output. $ git bundle verify x.bndl The bundle contains 2 refs b2611f37ebc7ed6435a72d77fbc5f8b48a7d7146 HEAD b2611f37ebc7ed6435a72d77fbc5f8b48a7d7146 refs/heads/master The bundle requires these 0 refs x.bndl is okay Reword "requires these 0 refs" to say "The bundle records a complete history" instead. Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 3fe4498 commit 8c3710f

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

bundle.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,16 @@ int verify_bundle(struct bundle_header *header, int verbose)
188188
r->nr),
189189
r->nr);
190190
list_refs(r, 0, NULL);
191-
r = &header->prerequisites;
192-
printf_ln(Q_("The bundle requires this ref",
193-
"The bundle requires these %d refs",
194-
r->nr),
195-
r->nr);
196-
list_refs(r, 0, NULL);
191+
if (!r->nr) {
192+
printf_ln(_("The bundle records a complete history."));
193+
} else {
194+
r = &header->prerequisites;
195+
printf_ln(Q_("The bundle requires this ref",
196+
"The bundle requires these %d refs",
197+
r->nr),
198+
r->nr);
199+
list_refs(r, 0, NULL);
200+
}
197201
}
198202
return ret;
199203
}

0 commit comments

Comments
 (0)