mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 20:54:59 +00:00
feature: allow fetch the latest remote changes into local branch which is not current branch (#617)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
489b57858f
commit
1442dcfe00
8 changed files with 102 additions and 2 deletions
|
@ -21,6 +21,16 @@ namespace SourceGit.Commands
|
|||
Args += remote;
|
||||
}
|
||||
|
||||
public Fetch(string repo, Models.Branch local, Models.Branch remote, Action<string> outputHandler)
|
||||
{
|
||||
_outputHandler = outputHandler;
|
||||
WorkingDirectory = repo;
|
||||
Context = repo;
|
||||
TraitErrorAsOutput = true;
|
||||
SSHKey = new Config(repo).Get($"remote.{remote.Remote}.sshkey");
|
||||
Args = $"fetch --progress --verbose {remote.Remote} {remote.Name}:{local.Name}";
|
||||
}
|
||||
|
||||
protected override void OnReadline(string line)
|
||||
{
|
||||
_outputHandler?.Invoke(line);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue