tree-walk: drop link_len cast in get_tree_entry_follow_symlinks()

Smallest piece of the tree topic. link_len is only used as
strbuf_splice()'s size_t length and as an array index; widening it
outright removes the cast_size_t_to_ulong() shim and the bridge
local that fed it. odb_read_object() now writes straight into
link_len.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2026-06-05 19:46:47 +02:00
parent 07faa066bd
commit 83f79b2e0d

View File

@@ -777,8 +777,7 @@ enum get_oid_result get_tree_entry_follow_symlinks(struct repository *r,
goto done;
} else if (S_ISLNK(*mode)) {
/* Follow a symlink */
unsigned long link_len;
size_t link_len_st = 0;
size_t link_len;
size_t len;
char *contents, *contents_start;
struct dir_state *parent;
@@ -798,8 +797,7 @@ enum get_oid_result get_tree_entry_follow_symlinks(struct repository *r,
contents = odb_read_object(r->objects,
&current_tree_oid, &type,
&link_len_st);
link_len = cast_size_t_to_ulong(link_len_st);
&link_len);
if (!contents)
goto done;