feature: supports searching revision files (#775)

This commit is contained in:
leo 2024-12-02 21:44:15 +08:00
parent 536f225867
commit 894f3e9b03
No known key found for this signature in database
10 changed files with 350 additions and 15 deletions

View file

@ -0,0 +1,21 @@
namespace SourceGit.Commands
{
public class QueryRevisionFileNames : Command
{
public QueryRevisionFileNames(string repo, string revision)
{
WorkingDirectory = repo;
Context = repo;
Args = $"ls-tree -r -z --name-only {revision}";
}
public string[] Result()
{
var rs = ReadToEnd();
if (rs.IsSuccess)
return rs.StdOut.Split('\0', System.StringSplitOptions.RemoveEmptyEntries);
return [];
}
}
}