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>
This commit is contained in:
16
bundle.c
16
bundle.c
@ -188,12 +188,16 @@ int verify_bundle(struct bundle_header *header, int verbose)
|
|||||||
r->nr),
|
r->nr),
|
||||||
r->nr);
|
r->nr);
|
||||||
list_refs(r, 0, NULL);
|
list_refs(r, 0, NULL);
|
||||||
r = &header->prerequisites;
|
if (!r->nr) {
|
||||||
printf_ln(Q_("The bundle requires this ref",
|
printf_ln(_("The bundle records a complete history."));
|
||||||
"The bundle requires these %d refs",
|
} else {
|
||||||
r->nr),
|
r = &header->prerequisites;
|
||||||
r->nr);
|
printf_ln(Q_("The bundle requires this ref",
|
||||||
list_refs(r, 0, NULL);
|
"The bundle requires these %d refs",
|
||||||
|
r->nr),
|
||||||
|
r->nr);
|
||||||
|
list_refs(r, 0, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user