mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-10 08:22:54 -05:00
The 'cmd_mktree()' function already receives a 'struct repository *repo' pointer, but it was previously marked as UNUSED. Pass the 'repo' pointer down to 'mktree_line()' and 'write_tree()'. Consequently, remove the 'USE_THE_REPOSITORY_VARIABLE' macro, replace usages of 'the_repository', and swap 'parse_oid_hex()' with its context-aware version 'parse_oid_hex_algop()'. This refactoring is safe because 'cmd_mktree()' is registered with the 'RUN_SETUP' flag in 'git.c', which guarantees that the command is executed within a initialized repository, ensuring that the passed 'repo' pointer is never 'NULL'. Signed-off-by: Tian Yuchen <cat@malon.dev> Signed-off-by: Junio C Hamano <gitster@pobox.com>
5.4 KiB
5.4 KiB