From e3efff4463c09f0070777000624f6b148873a0b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= Date: Thu, 31 Jul 2025 01:06:28 -0700 Subject: [PATCH] git-gui: ensure own version of git-gui--askpass is used MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When finding a location for the askpass helper, git will be asked for its exec path, but if that git is not the same that called git-gui then we might mistakenly point to its helper instead. Assume that git-gui and the helper are colocated to derive its path instead. This is specially useful in macOS where a broken version of that helper is provided by the system git. [j6t: move directory to variable to help in-flight topics] Suggested-by: Mark Levedahl Signed-off-by: Carlo Marcelo Arenas Belón Signed-off-by: Johannes Sixt --- git-gui.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/git-gui.sh b/git-gui.sh index 8bb121db4f..f28a23f844 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -1113,9 +1113,11 @@ citool { ## execution environment # Suggest our implementation of askpass, if none is set +set argv0dir [file dirname [file normalize $::argv0]] if {![info exists env(SSH_ASKPASS)]} { - set env(SSH_ASKPASS) [file join [git --exec-path] git-gui--askpass] + set env(SSH_ASKPASS) [file join $argv0dir git-gui--askpass] } +unset argv0dir ###################################################################### ## -- 2.47.2