2021-05-26 03:58:34 -07:00
|
|
|
using System;
|
|
|
|
|
2021-04-29 05:05:55 -07:00
|
|
|
namespace SourceGit.Commands {
|
|
|
|
/// <summary>
|
|
|
|
/// 合并分支
|
|
|
|
/// </summary>
|
|
|
|
public class Merge : Command {
|
2021-05-26 03:58:34 -07:00
|
|
|
private Action<string> handler = null;
|
2021-04-29 05:05:55 -07:00
|
|
|
|
2021-05-26 03:58:34 -07:00
|
|
|
public Merge(string repo, string source, string mode, Action<string> onProgress) {
|
2021-04-29 05:05:55 -07:00
|
|
|
Cwd = repo;
|
2021-05-26 03:58:34 -07:00
|
|
|
Args = $"merge --progress {source} {mode}";
|
|
|
|
TraitErrorAsOutput = true;
|
|
|
|
handler = onProgress;
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void OnReadline(string line) {
|
|
|
|
handler?.Invoke(line);
|
2021-04-29 05:05:55 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|