feature: add auto complete box for searching commits by file path

This commit is contained in:
leo 2024-07-30 15:59:54 +08:00
parent addfb449cc
commit 7f8b8a19a0
No known key found for this signature in database
4 changed files with 235 additions and 35 deletions

View file

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