]> git.ipfire.org Git - thirdparty/git.git/commit - cache-tree.c
tree-walk: init_tree_desc take an oid to get the hash algorithm
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 2 Oct 2023 02:40:28 +0000 (21:40 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Oct 2023 21:57:40 +0000 (14:57 -0700)
commitefed687edcaa272601e0f4e192db368972daa7ac
tree4324acf56dc0100cc5fa0c14d8e88cf3e337323d
parentd6222a2d05c93b22d5ef19b7361f7b1ef2964eb4
tree-walk: init_tree_desc take an oid to get the hash algorithm

To make it possible for git ls-tree to display the tree encoded
in the hash algorithm of the oid specified to git ls-tree, update
init_tree_desc to take as a parameter the oid of the tree object.

Update all callers of init_tree_desc and init_tree_desc_gently
to pass the oid of the tree object.

Use the oid of the tree object to discover the hash algorithm
of the oid and store that hash algorithm in struct tree_desc.

Use the hash algorithm in decode_tree_entry and
update_tree_entry_internal to handle reading a tree object encoded in
a hash algorithm that differs from the repositories hash algorithm.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
28 files changed:
archive.c
builtin/am.c
builtin/checkout.c
builtin/clone.c
builtin/commit.c
builtin/grep.c
builtin/merge.c
builtin/pack-objects.c
builtin/read-tree.c
builtin/stash.c
cache-tree.c
delta-islands.c
diff-lib.c
fsck.c
http-push.c
list-objects.c
match-trees.c
merge-ort.c
merge-recursive.c
merge.c
pack-bitmap-write.c
packfile.c
reflog.c
revision.c
tree-walk.c
tree-walk.h
tree.c
walker.c