]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/ls-tree: let the oid determine the output algorithm
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 2 Oct 2023 02:40:30 +0000 (21:40 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Oct 2023 21:57:40 +0000 (14:57 -0700)
commitc68be1fd31328472d994857e66c376dfc4562964
tree62a386cdc993336b1368c17b4f6bed6280af0ce7
parent8d691757b8fcbe9b7898a5d1dcb37b198a8c60e1
builtin/ls-tree: let the oid determine the output algorithm

Update cmd_ls_tree to call get_oid_with_context and pass
GET_OID_HASH_ANY instead of calling the simpler repo_get_oid.

This implments in ls-tree the behavior that asking to display a sha1
hash displays the corrresponding sha1 encoded object and asking to
display a sha256 hash displayes the corresponding sha256 encoded
object.

This is useful for testing the conversion of an object to an
equivlanet object encoded with a different hash function.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/ls-tree.c