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>
maint
Carlo Marcelo Arenas Belón 2025-07-31 01:06:28 -07:00 committed by Johannes Sixt
parent 0e3233b913
commit e3efff4463
1 changed files with 3 additions and 1 deletions

View File

@ -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

######################################################################
##