refactor<*>: rewrite all codes...

This commit is contained in:
leo 2021-04-29 20:05:55 +08:00
parent 89ff8aa744
commit 30ab8ae954
342 changed files with 17208 additions and 19633 deletions

View file

@ -0,0 +1,28 @@
using System;
namespace SourceGit.Commands {
/// <summary>
/// 取得一个LFS对象的信息
/// </summary>
public class QueryLFSObject : Command {
private Models.LFSObject obj = new Models.LFSObject();
public QueryLFSObject(string repo, string commit, string path) {
Cwd = repo;
Args = $"show {commit}:\"{path}\"";
}
public Models.LFSObject Result() {
Exec();
return obj;
}
public override void OnReadline(string line) {
if (line.StartsWith("oid sha256:", StringComparison.Ordinal)) {
obj.OID = line.Substring(11).Trim();
} else if (line.StartsWith("size")) {
obj.Size = int.Parse(line.Substring(4).Trim());
}
}
}
}