/
vasiukoff
/
sg
Обзор
Документация
Войти
/
vasiukoff
/
sg
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/Commands/IsLFSFiltered.cs
39 строк
1000 B
leo
fix: main thread deadlock cause by calling `.Result` directly (#1720)
12 авг 2025, 11:03
12 авг 2025, 11:03
bd81ccd
Код
Авторство
О чём код?
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"); } } }