forked from sourcegit-scm/sourcegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIsLFSFiltered.cs
More file actions
29 lines (26 loc) · 819 Bytes
/
IsLFSFiltered.cs
File metadata and controls
29 lines (26 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System.Threading.Tasks;
namespace SourceGit.Commands
{
public class IsLFSFiltered : Command
{
public IsLFSFiltered(string repo, string path)
{
WorkingDirectory = repo;
Context = repo;
Args = $"check-attr -z filter {path.Quoted()}";
RaiseError = false;
}
public IsLFSFiltered(string repo, string sha, string path)
{
WorkingDirectory = repo;
Context = repo;
Args = $"check-attr --source {sha} -z filter {path.Quoted()}";
RaiseError = false;
}
public async Task<bool> GetResultAsync()
{
var rs = await ReadToEndAsync().ConfigureAwait(false);
return rs.IsSuccess && rs.StdOut.Contains("filter\0lfs");
}
}
}