git-gui: ensure own version of git-gui--askpass is used

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 <mlevedahl@gmail.com> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Johannes Sixt <j6t@kdbg.org>

Carlo Marcelo Arenas Belón committed Jul 31, 2025 at 01:06 UTC e3efff4463c09f0070777000624f6b148873a0b5
1 file changed +3 -1
git-gui.sh
+3 -1
@@ -1113,9 +1113,11 @@ citool {
1113 ## execution environment
1114
1115 # Suggest our implementation of askpass, if none is set
1116 +set argv0dir [file dirname [file normalize $::argv0]]
1117 if {![info exists env(SSH_ASKPASS)]} {
1117 - set env(SSH_ASKPASS) [file join [git --exec-path] git-gui--askpass]
1118 + set env(SSH_ASKPASS) [file join $argv0dir git-gui--askpass]
1119 }
1120 +unset argv0dir
1121
1122 ######################################################################
1123 ##