forked from sourcegit-scm/sourcegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPull.cs
More file actions
29 lines (23 loc) · 750 Bytes
/
Copy pathPull.cs
File metadata and controls
29 lines (23 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System.Threading.Tasks;
namespace SourceGit.Commands
{
public class Pull : Command
{
public Pull(string repo, string remote, string branch, bool useRebase)
{
_remote = remote;
WorkingDirectory = repo;
Context = repo;
Args = "pull --verbose --progress ";
if (useRebase)
Args += "--rebase=true ";
Args += $"{remote} {branch}";
}
public async Task<bool> RunAsync()
{
SSHKey = await new Config(WorkingDirectory).GetAsync($"remote.{_remote}.sshkey").ConfigureAwait(false);
return await ExecAsync().ConfigureAwait(false);
}
private readonly string _remote;
}
}