gitk: _search_exe is no longer needed

The _search_exe variable allows specifying the suffix used for executables, typically {} on unix, .exe on Windows. But, the override code is now used only on Windows, so _search_exe is no longer needed. Eliminate it. Signed-off-by: Mark Levedahl <mlevedahl@gmail.com> Signed-off-by: Johannes Sixt <j6t@kdbg.org>

Mark Levedahl committed Mar 31, 2025 at 23:01 UTC 74571bff17986359170f7dcf135c9a21bbdce06e
1 file changed +2 -3
gitk
+2 -3
@@ -27,7 +27,7 @@ proc is_Windows {} {
27 if {[is_Windows]} {
28 set _search_path {}
29 proc _which {what args} {
30 - global env _search_exe _search_path
30 + global env _search_path
31
32 if {$_search_path eq {}} {
33 set gitguidir [file dirname [info script]]
@@ -37,13 +37,12 @@ if {[is_Windows]} {
37 # Skip empty `PATH` elements
38 set _search_path [lsearch -all -inline -not -exact \
39 $_search_path ""]
40 - set _search_exe .exe
40 }
41
42 if {[lsearch -exact $args -script] >= 0} {
43 set suffix {}
44 } else {
46 - set suffix $_search_exe
45 + set suffix .exe
46 }
47
48 foreach p $_search_path {