mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 12:15:00 +00:00
refactor: base command
This commit is contained in:
parent
dda1e79c6f
commit
446445ee73
7 changed files with 42 additions and 85 deletions
|
@ -13,14 +13,9 @@ namespace SourceGit.Commands
|
|||
WorkingDirectory = repo;
|
||||
Context = repo;
|
||||
TraitErrorAsOutput = true;
|
||||
SSHKey = new Config(repo).Get($"remote.{remote}.sshkey");
|
||||
Args = "fetch --progress --verbose ";
|
||||
|
||||
var sshKey = new Config(repo).Get($"remote.{remote}.sshkey");
|
||||
if (string.IsNullOrEmpty(sshKey))
|
||||
Args = "-c credential.helper=manager ";
|
||||
else
|
||||
UseSSHKey(sshKey);
|
||||
|
||||
Args += "fetch --progress --verbose ";
|
||||
if (prune)
|
||||
Args += "--prune ";
|
||||
|
||||
|
@ -40,14 +35,8 @@ namespace SourceGit.Commands
|
|||
WorkingDirectory = repo;
|
||||
Context = repo;
|
||||
TraitErrorAsOutput = true;
|
||||
|
||||
var sshKey = new Config(repo).Get($"remote.{remote}.sshkey");
|
||||
if (string.IsNullOrEmpty(sshKey))
|
||||
Args = "-c credential.helper=manager ";
|
||||
else
|
||||
UseSSHKey(sshKey);
|
||||
|
||||
Args += $"fetch --progress --verbose {remote} {remoteBranch}:{localBranch}";
|
||||
SSHKey = new Config(repo).Get($"remote.{remote}.sshkey");
|
||||
Args = $"fetch --progress --verbose {remote} {remoteBranch}:{localBranch}";
|
||||
}
|
||||
|
||||
protected override void OnReadline(string line)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue