]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-gui: use [is_Windows], not bad _shellpath
authorMark Levedahl <mlevedahl@gmail.com>
Wed, 2 Apr 2025 15:23:03 +0000 (11:23 -0400)
committerTaylor Blau <me@ttaylorr.com>
Fri, 23 May 2025 21:04:23 +0000 (17:04 -0400)
Commit 7d076d56757c (git-gui: handle shell script text filters when
loading for blame, 2011-12-09) added open_cmd_pipe, with special
handling for Windows detected by seeing that _shellpath does not
point to an executable shell. That is bad practice, and is broken by
the next commit that assures _shellpath is valid on all platforms.

Fix this by using [is_Windows] as done for all Windows specific code.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
git-gui.sh

index 2e079b6ab138a1e568f9815f82677dcea2bcd285..3135116169f8ffdfe849731a578d6946840f79c1 100755 (executable)
@@ -543,7 +543,7 @@ proc is_shellscript {filename} {
 # scripts specifically otherwise just call the filter command.
 proc open_cmd_pipe {cmd path} {
        global env
-       if {![file executable [shellpath]]} {
+       if {[is_Windows]} {
                set exe [auto_execok [lindex $cmd 0]]
                if {[is_shellscript [lindex $exe 0]]} {
                        set run [linsert [auto_execok sh] end -c "$cmd \"\$0\"" $path]