diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-09-18 20:52:30 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-09-18 20:52:30 +0300 |
commit | c22e9efe9c283ec34a4bb79856114088ee616237 (patch) | |
tree | 12093c8feec8eb1a4a80dbb7b93208ff818e7632 /git-gui | |
parent | bda494f4043963b9ec9a1ecd4b19b7d1cd9a0518 (diff) | |
parent | 0730a5a3a5e69e4b5fa0fbf6edd7fcbd7a08c992 (diff) |
Merge git-gui into ml/git-gui-exec-path-fix
* git-gui:
git-gui - use git-hook, honor core.hooksPath
git-gui - re-enable use of hook scripts
Diffstat (limited to 'git-gui')
-rwxr-xr-x | git-gui/git-gui.sh | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh index 8bc8892c40..3e5907a460 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -118,7 +118,7 @@ proc sanitize_command_line {command_line from_index} { set i $from_index while {$i < [llength $command_line]} { set cmd [lindex $command_line $i] - if {[file pathtype $cmd] ne "absolute"} { + if {[llength [file split $cmd]] < 2} { set fullpath [_which $cmd] if {$fullpath eq ""} { throw {NOT-FOUND} "$cmd not found in PATH" @@ -661,31 +661,8 @@ proc git_write {args} { } proc githook_read {hook_name args} { - set pchook [gitdir hooks $hook_name] - lappend args 2>@1 - - # On Windows [file executable] might lie so we need to ask - # the shell if the hook is executable. Yes that's annoying. - # - if {[is_Windows]} { - upvar #0 _sh interp - if {![info exists interp]} { - set interp [_which sh] - } - if {$interp eq {}} { - error "hook execution requires sh (not in PATH)" - } - - set scr {if test -x "$1";then exec "$@";fi} - set sh_c [list $interp -c $scr $interp $pchook] - return [_open_stdout_stderr [concat $sh_c $args]] - } - - if {[file executable $pchook]} { - return [_open_stdout_stderr [concat [list $pchook] $args]] - } - - return {} + set cmd [concat git hook run --ignore-missing $hook_name -- $args 2>@1] + return [_open_stdout_stderr $cmd] } proc kill_file_process {fd} { |