File tree Expand file tree Collapse file tree 1 file changed +3
-26
lines changed Expand file tree Collapse file tree 1 file changed +3
-26
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ proc sanitize_command_line {command_line from_index} {
118
118
set i $from_index
119
119
while {$i < [ llength $command_line ] } {
120
120
set cmd [ lindex $command_line $i ]
121
- if {[ file pathtype $cmd ] ne " absolute " } {
121
+ if {[ llength [ file split $cmd ] ] < 2 } {
122
122
set fullpath [ _which $cmd ]
123
123
if {$fullpath eq " " } {
124
124
throw {NOT-FOUND} " $cmd not found in PATH"
@@ -661,31 +661,8 @@ proc git_write {args} {
661
661
}
662
662
663
663
proc githook_read {hook_name args} {
664
- set pchook [gitdir hooks $hook_name ]
665
- lappend args 2>@1
666
-
667
- # On Windows [file executable] might lie so we need to ask
668
- # the shell if the hook is executable. Yes that's annoying.
669
- #
670
- if {[is_Windows]} {
671
- upvar #0 _sh interp
672
- if {![info exists interp]} {
673
- set interp [_which sh]
674
- }
675
- if {$interp eq {}} {
676
- error " hook execution requires sh (not in PATH)"
677
- }
678
-
679
- set scr {if test -x " $1 " ;then exec " $@" ;fi}
680
- set sh_c [list $interp -c $scr $interp $pchook ]
681
- return [_open_stdout_stderr [concat $sh_c $args ]]
682
- }
683
-
684
- if {[file executable $pchook ]} {
685
- return [_open_stdout_stderr [concat [list $pchook ] $args ]]
686
- }
687
-
688
- return {}
664
+ set cmd [concat git hook run --ignore-missing $hook_name -- $args 2>@1]
665
+ return [_open_stdout_stderr $cmd ]
689
666
}
690
667
691
668
proc kill_file_process {fd} {
You can’t perform that action at this time.
0 commit comments