fix: SSH_ASKPASS can NOT use parameter

This commit is contained in:
leo 2024-07-10 10:47:43 +08:00
parent 7febac5843
commit ca461d1926
No known key found for this signature in database
3 changed files with 4 additions and 3 deletions

View file

@ -456,10 +456,10 @@ namespace SourceGit
private bool TryLaunchedAsAskpass(IClassicDesktopStyleApplicationLifetime desktop)
{
var args = desktop.Args;
if (args.Length <= 1 || !args[0].Equals("--askpass", StringComparison.Ordinal))
if (args.Length != 1 || !args[0].StartsWith("Enter passphrase", StringComparison.Ordinal))
return false;
desktop.MainWindow = new Views.Askpass(args[1]);
desktop.MainWindow = new Views.Askpass(args[0]);
return true;
}