Skip to content

Commit 074c2b9

Browse files
j6tttaylorr
authored andcommitted
git-gui: use git_read in githook_read
0730a5a ("git-gui - use git-hook, honor core.hooksPath", 2023-09-17) rewrote githook_read to use `git hook` to run a hook script. The code that was replaced discovered the hook script file manually and invoked it using function _open_stdout_stderr. After the rewrite, this function is still invoked, but it calls into `git` instead of the hook scripts. Notice though, that we have function git_read that invokes git and prepares a pipe for the caller to read from. Replace the implementation of githook_read to be just a wrapper around git_read. This unifies the way in which the git executable is invoked. git_read ultimately also calls into _open_stdout_stderr, but it modifies the path to the git executable before doing so. Signed-off-by: Johannes Sixt <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent aa42e87 commit 074c2b9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

git-gui.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,8 +669,7 @@ proc git_write {args} {
669669
}
670670

671671
proc githook_read {hook_name args} {
672-
set cmd [concat git hook run --ignore-missing $hook_name -- $args 2>@1]
673-
return [_open_stdout_stderr $cmd]
672+
git_read hook run --ignore-missing $hook_name -- $args 2>@1
674673
}
675674

676675
proc kill_file_process {fd} {

0 commit comments

Comments
 (0)