-
Notifications
You must be signed in to change notification settings - Fork 386
Expand file tree
/
Copy pathIsLFSFiltered.cs
More file actions
39 lines (34 loc) · 1000 Bytes
/
IsLFSFiltered.cs
File metadata and controls
39 lines (34 loc) · 1000 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
30
31
32
33
34
35
36
37
38
39
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 bool GetResult()
{
return Parse(ReadToEnd());
}
public async Task<bool> GetResultAsync()
{
var rs = await ReadToEndAsync().ConfigureAwait(false);
return Parse(rs);
}
private bool Parse(Result rs)
{
return rs.IsSuccess && rs.StdOut.Contains("filter\0lfs");
}
}
}