using System.Collections.Generic;
namespace SourceGit.Commands {
///
/// 取得指定提交下的某文件内容
///
public class QueryFileContent : Command {
private List lines = new List();
private int added = 0;
public QueryFileContent(string repo, string commit, string path) {
Cwd = repo;
Args = $"show {commit}:\"{path}\"";
}
public List Result() {
Exec();
return lines;
}
public override void OnReadline(string line) {
added++;
lines.Add(new Models.TextLine() { Number = added, Data = line });
}
}
}