-
Notifications
You must be signed in to change notification settings - Fork 436
Expand file tree
/
Copy pathMerge.cs
More file actions
45 lines (38 loc) · 1.26 KB
/
Copy pathMerge.cs
File metadata and controls
45 lines (38 loc) · 1.26 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
using System.Collections.Generic;
using System.Text;
namespace SourceGit.Commands
{
public class Merge : Command
{
public Merge(string repo, string source, string mode, bool edit)
{
WorkingDirectory = repo;
Context = repo;
Editor = EditorType.CoreEditor;
var builder = new StringBuilder();
builder.Append("merge --progress ");
builder.Append(edit ? "--edit " : "--no-edit ");
builder.Append(source);
builder.Append(' ');
builder.Append(mode);
Args = builder.ToString();
}
public Merge(string repo, List<string> targets, bool autoCommit, string strategy)
{
WorkingDirectory = repo;
Context = repo;
var builder = new StringBuilder();
builder.Append("merge --progress ");
if (!string.IsNullOrEmpty(strategy))
builder.Append("--strategy=").Append(strategy).Append(' ');
if (!autoCommit)
builder.Append("--no-commit ");
foreach (var t in targets)
{
builder.Append(t);
builder.Append(' ');
}
Args = builder.ToString();
}
}
}