-
Notifications
You must be signed in to change notification settings - Fork 204
/
Copy pathFetch.cs
31 lines (27 loc) · 897 Bytes
/
Fetch.cs
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
namespace SourceGit.Commands
{
public class Fetch : Command
{
public Fetch(string repo, string remote, bool noTags, bool force)
{
WorkingDirectory = repo;
Context = repo;
SSHKey = new Config(repo).Get($"remote.{remote}.sshkey");
Args = "fetch --progress --verbose ";
if (noTags)
Args += "--no-tags ";
else
Args += "--tags ";
if (force)
Args += "--force ";
Args += remote;
}
public Fetch(string repo, Models.Branch local, Models.Branch remote)
{
WorkingDirectory = repo;
Context = repo;
SSHKey = new Config(repo).Get($"remote.{remote.Remote}.sshkey");
Args = $"fetch --progress --verbose {remote.Remote} {remote.Name}:{local.Name}";
}
}
}