builtin/verify-pack: implement an --object-format option
authorbrian m. carlson <redacted>
Wed, 29 Jul 2020 23:14:19 +0000 (23:14 +0000)
committerJunio C Hamano <redacted>
Thu, 30 Jul 2020 16:16:48 +0000 (09:16 -0700)
commite74b606d47ff65de497b06ac6c8ace6761cceea1
tree8baf06d35c6038dfd7ff717cdbc1941604170ceb
parent439d3a17b66d7e2f15fac72960a09261b72ac0d7
builtin/verify-pack: implement an --object-format option

A recently added test in t5702 started using git verify-pack outside of
a repository.  While this poses no problems with SHA-1, with SHA-256 we
implicitly rely on the setup of the repository to initialize our hash
algorithm settings.

Since we're not in a repository here, we need to provide git verify-pack
help to set things up properly.  git index-pack already knows an
--object-format option, so let's accept one as well and pass it down to
our git index-pack invocation.  Since we're now dynamically adjusting
the elements in argv, let's switch to using struct argv_array to manage
them.  Finally, let's make t5702 pass the proper argument on down to its
git verify-pack caller.

Signed-off-by: brian m. carlson <redacted>
Reviewed-by: Eric Sunshine <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/verify-pack.c
t/t5702-protocol-v2.sh
git clone https://git.99rst.org/PROJECT