meson: fix overwritten `git` variable

We're assigning the `git` variable in three places: - In "meson.build" to store the external Git executable. - In "meson.build" to store the compiled Git executable. - In "Documentation/meson.build" to store the external Git executable, a second time. The last case is only needed because we overwrite the original variable with the built version. Rename the variable used for the built Git executable so that we don't have to resolve the external Git executable multiple times. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Feb 26, 2025 at 09:22 UTC 3ee3a6eb522fd3ad672e7734e5708f5ddcc63fce
2 files changed +3 -4
Documentation/meson.build
-1
@@ -283,7 +283,6 @@ elif docs_backend == 'asciidoctor'
283 ]
284 endif
285
286 -git = find_program('git', required: false)
286 xmlto = find_program('xmlto')
287
288 cmd_lists = [
meson.build
+3 -3
@@ -1608,13 +1608,13 @@ libgit_commonmain = declare_dependency(
1608 bin_wrappers = [ ]
1609 test_dependencies = [ ]
1610
1611 -git = executable('git',
1611 +git_builtin = executable('git',
1612 sources: builtin_sources + 'git.c',
1613 dependencies: [libgit_commonmain],
1614 install: true,
1615 install_dir: get_option('libexecdir') / 'git-core',
1616 )
1617 -bin_wrappers += git
1617 +bin_wrappers += git_builtin
1618
1619 test_dependencies += executable('git-daemon',
1620 sources: 'daemon.c',
@@ -1705,7 +1705,7 @@ test_dependencies += executable('git-imap-send',
1705
1706 foreach alias : [ 'git-receive-pack', 'git-upload-archive', 'git-upload-pack' ]
1707 bin_wrappers += executable(alias,
1708 - objects: git.extract_all_objects(recursive: false),
1708 + objects: git_builtin.extract_all_objects(recursive: false),
1709 dependencies: [libgit_commonmain],
1710 )
1711