-
Notifications
You must be signed in to change notification settings - Fork 436
Expand file tree
/
Copy pathPull.cs
More file actions
32 lines (25 loc) · 833 Bytes
/
Copy pathPull.cs
File metadata and controls
32 lines (25 loc) · 833 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
30
31
32
using System.Threading.Tasks;
namespace SourceGit.Commands
{
public class Pull : Command
{
public Pull(string repo, string remote, string branch, bool useRebase, int depth)
{
_remote = remote;
WorkingDirectory = repo;
Context = repo;
Args = "pull --verbose --progress ";
if (useRebase)
Args += "--rebase=true ";
if(depth > 0)
Args += $"--depth {depth} ";
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;
}
}