diff options
| author | Johannes Sixt <j6t@kdbg.org> | 2025-03-29 17:35:19 +0100 |
|---|---|---|
| committer | Taylor Blau <me@ttaylorr.com> | 2025-05-23 17:03:30 -0400 |
| commit | 30846b43060c3d57575b59b9aaa80c4bd1688171 (patch) | |
| tree | 722cf65dccd76de75f8cb854927a7c962321fac4 | |
| parent | gitk: sanitize 'exec' arguments: redirections and background (diff) | |
| download | git-30846b43060c3d57575b59b9aaa80c4bd1688171.tar.gz git-30846b43060c3d57575b59b9aaa80c4bd1688171.zip | |
gitk: sanitize 'exec' arguments: redirect to process
Convert one 'exec' call that sends output to a process (pipeline).
Fortunately, the command does not contain any variables. For this
reason, just treat it as a "redirection".
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
| -rwxr-xr-x | gitk | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -43,7 +43,7 @@ proc safe_exec {cmd} { # executes one command with redirections # no pipelines are possible # cmd is a list that specifies the command and its arguments -# redir is a list that specifies redirections (output, background) +# redir is a list that specifies redirections (output, background, constant(!) commands) # calls `exec` and returns its value proc safe_exec_redirect {cmd redir} { eval exec [make_arglist_safe $cmd] $redir @@ -9120,7 +9120,7 @@ proc getpatchid {id} { if {![info exists patchids($id)]} { set cmd [diffcmd [list $id] {-p --root}] if {[catch { - set x [eval exec $cmd | git patch-id] + set x [safe_exec_redirect $cmd [list | git patch-id]] set patchids($id) [lindex $x 0] }]} { set patchids($id) "error" |
