提交 d5257fb3 编写于 作者: P Pat Thoyts

git-gui: handle textconv filter on Windows and in development

When developing/testing we run git-gui.sh directly and the makefile
configured variables are not properly set. Configure the new shellpath
accessor to handle this case.

On Windows we may not find the shell so in this case revert to simply
executing the filter command without the shell intermediate.
Signed-off-by: NPat Thoyts <patthoyts@users.sourceforge.net>
上级 62f9a632
......@@ -139,7 +139,14 @@ if {$_trace >= 0} {
}
proc shellpath {} {
global _shellpath
global _shellpath env
if {[string match @@* $_shellpath]} {
if {[info exists env(SHELL)]} {
return $env(SHELL)
} else {
return /bin/sh
}
}
return $_shellpath
}
......
......@@ -461,8 +461,13 @@ method _load {jump} {
if {$commit eq {}} {
if {$do_textconv ne 0} {
# Run textconv with sh -c "..." to allow it to
# contain command + arguments.
set fd [open |[list [shellpath] -c "$textconv \"\$0\"" $path] r]
# contain command + arguments. On windows, just
# call the filter command.
if {![file executable [shellpath]]} {
set fd [open |[linsert $textconv end $path] r]
} else {
set fd [open |[list [shellpath] -c "$textconv \"\$0\"" $path] r]
}
} else {
set fd [open $path r]
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册