mirror of
https://github.com/git-for-windows/git.git
synced 2026-07-05 04:01:03 -05:00
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:
@@ -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,
|
||||
¤t_tree_oid, &type,
|
||||
&link_len_st);
|
||||
link_len = cast_size_t_to_ulong(link_len_st);
|
||||
&link_len);
|
||||
|
||||
if (!contents)
|
||||
goto done;
|
||||
|
||||
Reference in New Issue
Block a user