/
vasiukoff
/
sg
Обзор
Документация
Войти
/
vasiukoff
/
sg
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/Commands/QueryRevisionFileNames.cs
39 строк
1 KB
leo
enhance: do not return to `UIThread` while calculating git outputs
25 ноя 2025, 10:31
25 ноя 2025, 10:31
c187480
Код
Авторство
О чём код?
using System.Collections.Generic; using System.Diagnostics; using System.Threading.Tasks; namespace SourceGit.Commands { public class QueryRevisionFileNames : Command { public QueryRevisionFileNames(string repo, string revision) { WorkingDirectory = repo; Context = repo; Args = $"ls-tree -r --name-only {revision}"; } public async Task<List<string>> GetResultAsync() { var outs = new List<string>(); try { using var proc = new Process(); proc.StartInfo = CreateGitStartInfo(true); proc.Start(); while (await proc.StandardOutput.ReadLineAsync().ConfigureAwait(false) is { Length: > 0 } line) outs.Add(line); await proc.WaitForExitAsync().ConfigureAwait(false); } catch { // Ignore exceptions. } return outs; } } }