feature: support git.core.askpass (#239)

This commit is contained in:
leo 2024-07-08 22:07:00 +08:00
parent 8fa19ecd0c
commit cbe4c36525
No known key found for this signature in database
14 changed files with 211 additions and 60 deletions

View file

@ -52,14 +52,10 @@
cmd.Context = repo;
var sshKey = new Config(repo).Get($"remote.{remote}.sshkey");
if (!string.IsNullOrEmpty(sshKey))
{
cmd.Args = $"-c core.sshCommand=\"ssh -i '{sshKey}'\" ";
}
else
{
if (string.IsNullOrEmpty(sshKey))
cmd.Args = "-c credential.helper=manager ";
}
else
cmd.UseSSHKey(sshKey);
cmd.Args += $"push {remote} --delete {name}";
return cmd.Exec();