sourcegit/src/Commands/Merge.cs

22 lines
554 B
C#
Raw Normal View History

using System;
2021-04-29 05:05:55 -07:00
namespace SourceGit.Commands {
/// <summary>
/// 合并分支
/// </summary>
public class Merge : Command {
private Action<string> handler = null;
2021-04-29 05:05:55 -07:00
public Merge(string repo, string source, string mode, Action<string> onProgress) {
2021-04-29 05:05:55 -07:00
Cwd = repo;
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
}
}
}