bundle: output hash information in 'verify'

The previous change moved the 'filter' capability to the end of the 'git
bundle verify' output. Now, add the 'object-format' capability to the
output, when it exists.

This change makes 'git bundle verify' output the hash used in all cases,
even if the capability is not in the bundle. This means that v2 bundles
will always output that they use "sha1". This might look noisy to some
users, but it does simplify the implementation and the test strategy for
this feature.

Since 'verify' ends early when a prerequisite commit is missing, we need
to insert this hash message carefully into our expected test output
throughout t6020.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Derrick Stolee
2022-03-22 17:28:39 +00:00
committed by Junio C Hamano
parent 017303eb48
commit 8ba221e245
2 changed files with 19 additions and 7 deletions

View File

@ -278,6 +278,8 @@ int verify_bundle(struct repository *r,
list_refs(r, 0, NULL);
}
printf_ln("The bundle uses this hash algorithm: %s",
header->hash_algo->name);
if (header->filter.choice)
printf_ln("The bundle uses this filter: %s",
list_objects_filter_spec(&header->filter));