mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
fix: commit stucks when using SSH formatted GPG signing with a key contains non-empty passphrase
This commit is contained in:
parent
386c92fa28
commit
9db050e8c2
5 changed files with 19 additions and 19 deletions
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
using Avalonia.Threading;
|
||||
|
||||
namespace SourceGit.Commands
|
||||
|
@ -38,11 +39,16 @@ namespace SourceGit.Commands
|
|||
public Dictionary<string, string> Envs { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
public void UseSSHKey(string key)
|
||||
{
|
||||
UseSSHAskpass();
|
||||
Envs.Add("GIT_SSH_COMMAND", $"ssh -i '{key}'");
|
||||
}
|
||||
|
||||
public void UseSSHAskpass()
|
||||
{
|
||||
Envs.Add("DISPLAY", "required");
|
||||
Envs.Add("SSH_ASKPASS", $"\"{Process.GetCurrentProcess().MainModule.FileName}\" --askpass");
|
||||
Envs.Add("SSH_ASKPASS_REQUIRE", "prefer");
|
||||
Envs.Add("GIT_SSH_COMMAND", $"ssh -i '{key}'");
|
||||
}
|
||||
|
||||
public bool Exec()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue