mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 12:15:00 +00:00
feature<Fast-Forward>: allow fast-forward on local branch that not checked out.
This commit is contained in:
parent
12511007e3
commit
9d6ac9c449
4 changed files with 88 additions and 1 deletions
|
@ -29,6 +29,22 @@ namespace SourceGit.Commands {
|
|||
AutoFetch.MarkFetched(repo);
|
||||
}
|
||||
|
||||
public Fetch(string repo, string remote, string localBranch, string remoteBranch, Action<string> outputHandler) {
|
||||
Cwd = repo;
|
||||
TraitErrorAsOutput = true;
|
||||
|
||||
var sshKey = new Config(repo).Get($"remote.{remote}.sshkey");
|
||||
if (!string.IsNullOrEmpty(sshKey)) {
|
||||
Envs.Add("GIT_SSH_COMMAND", $"ssh -i '{sshKey}'");
|
||||
Args = "";
|
||||
} else {
|
||||
Args = "-c credential.helper=manager-core ";
|
||||
}
|
||||
|
||||
Args += $"fetch --progress --verbose {remote} {remoteBranch}:{localBranch}";
|
||||
handler = outputHandler;
|
||||
}
|
||||
|
||||
public override void OnReadline(string line) {
|
||||
handler?.Invoke(line);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue