fix: ssh-askpass not working (#272)

This commit is contained in:
leo 2024-07-23 13:48:52 +08:00
parent d4b262248a
commit e0319e3f9b
No known key found for this signature in database

View file

@ -501,10 +501,15 @@ namespace SourceGit
private bool TryLaunchedAsAskpass(IClassicDesktopStyleApplicationLifetime desktop) private bool TryLaunchedAsAskpass(IClassicDesktopStyleApplicationLifetime desktop)
{ {
var args = desktop.Args; var args = desktop.Args;
if (args == null || args.Length != 1 || !args[0].StartsWith("Enter passphrase", StringComparison.Ordinal)) if (args == null || args.Length != 1)
return false; return false;
desktop.MainWindow = new Views.Askpass(args[0]); var param = args[0];
if (!param.StartsWith("enter passphrase", StringComparison.OrdinalIgnoreCase) &&
!param.Contains(" password", StringComparison.OrdinalIgnoreCase))
return false;
desktop.MainWindow = new Views.Askpass(param);
return true; return true;
} }