From 99f7bc1af65fabab907bf35e645241f714e7386e Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Sun, 4 May 2025 20:26:11 +0200 Subject: git-gui: introduce function git_redir for git calls with redirections Proc git invokes git and collects all output, which is it returns. We are going to treat command arguments and redirections differently to avoid passing arguments that look like redirections to the command accidentally. A few invocations also pass redirection operators as command arguments deliberately. Rewrite these cases to use a new function git_redir that takes two lists, one for the regular command arguments and one for the redirection operations. Signed-off-by: Johannes Sixt Signed-off-by: Taylor Blau --- lib/commit.tcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/commit.tcl') diff --git a/lib/commit.tcl b/lib/commit.tcl index b27e37d385..bb6056d0ad 100644 --- a/lib/commit.tcl +++ b/lib/commit.tcl @@ -388,8 +388,8 @@ A rescan will be automatically started now. foreach p [concat $PARENT $MERGE_HEAD] { lappend cmd -p $p } - lappend cmd <$msg_p - if {[catch {set cmt_id [eval git $cmd]} err]} { + set msgtxt [list <$msg_p] + if {[catch {set cmt_id [git_redir $cmd $msgtxt]} err]} { catch {file delete $msg_p} error_popup [strcat [mc "commit-tree failed:"] "\n\n$err"] ui_status [mc "Commit failed."] -- cgit 1.2.3-korg