Skip to content

Commit c187480

Browse files
committed
enhance: do not return to UIThread while calculating git outputs
Signed-off-by: leo <[email protected]>
1 parent 211d73a commit c187480

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

src/Commands/CompareRevisions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public CompareRevisions(string repo, string start, string end, string path)
3939
proc.StartInfo = CreateGitStartInfo(true);
4040
proc.Start();
4141

42-
while (await proc.StandardOutput.ReadLineAsync() is { } line)
42+
while (await proc.StandardOutput.ReadLineAsync().ConfigureAwait(false) is { } line)
4343
{
4444
var match = REG_FORMAT().Match(line);
4545
if (!match.Success)

src/Commands/Diff.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public Diff(string repo, Models.DiffOption opt, int unified, bool ignoreWhitespa
4141
proc.StartInfo = CreateGitStartInfo(true);
4242
proc.Start();
4343

44-
while (await proc.StandardOutput.ReadLineAsync() is { } line)
44+
while (await proc.StandardOutput.ReadLineAsync().ConfigureAwait(false) is { } line)
4545
ParseLine(line);
4646

4747
await proc.WaitForExitAsync().ConfigureAwait(false);

src/Commands/QueryCommits.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public QueryCommits(string repo, string filter, Models.CommitSearchMethod method
6363
proc.StartInfo = CreateGitStartInfo(true);
6464
proc.Start();
6565

66-
while (await proc.StandardOutput.ReadLineAsync() is { } line)
66+
while (await proc.StandardOutput.ReadLineAsync().ConfigureAwait(false) is { } line)
6767
{
6868
var parts = line.Split('\0');
6969
if (parts.Length != 8)

src/Commands/QueryCurrentBranchCommitHashes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public async Task<HashSet<string>> GetResultAsync()
2525
proc.StartInfo = CreateGitStartInfo(true);
2626
proc.Start();
2727

28-
while (await proc.StandardOutput.ReadLineAsync() is { Length: > 8 } line)
28+
while (await proc.StandardOutput.ReadLineAsync().ConfigureAwait(false) is { Length: > 8 } line)
2929
outs.Add(line);
3030

3131
await proc.WaitForExitAsync().ConfigureAwait(false);

src/Commands/QueryLocalChanges.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public QueryLocalChanges(string repo, bool includeUntracked = true)
2828
proc.StartInfo = CreateGitStartInfo(true);
2929
proc.Start();
3030

31-
while (await proc.StandardOutput.ReadLineAsync() is { } line)
31+
while (await proc.StandardOutput.ReadLineAsync().ConfigureAwait(false) is { } line)
3232
{
3333
var match = REG_FORMAT().Match(line);
3434
if (!match.Success)

src/Commands/QueryRevisionFileNames.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public async Task<List<string>> GetResultAsync()
2323
proc.StartInfo = CreateGitStartInfo(true);
2424
proc.Start();
2525

26-
while (await proc.StandardOutput.ReadLineAsync() is { Length: > 0 } line)
26+
while (await proc.StandardOutput.ReadLineAsync().ConfigureAwait(false) is { Length: > 0 } line)
2727
outs.Add(line);
2828

2929
await proc.WaitForExitAsync().ConfigureAwait(false);

src/Commands/QueryRevisionObjects.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public QueryRevisionObjects(string repo, string sha, string parentFolder)
3030
proc.StartInfo = CreateGitStartInfo(true);
3131
proc.Start();
3232

33-
while (await proc.StandardOutput.ReadLineAsync() is { } line)
33+
while (await proc.StandardOutput.ReadLineAsync().ConfigureAwait(false) is { } line)
3434
{
3535
var match = REG_FORMAT().Match(line);
3636
if (!match.Success)

src/ViewModels/CommitDetail.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ private void Refresh()
370370
var message = await new Commands.QueryCommitFullMessage(_repo.FullPath, _commit.SHA)
371371
.GetResultAsync()
372372
.ConfigureAwait(false);
373-
var inlines = await ParseInlinesInMessageAsync(message);
373+
var inlines = await ParseInlinesInMessageAsync(message).ConfigureAwait(false);
374374

375375
if (!token.IsCancellationRequested)
376376
Dispatcher.UIThread.Post(() =>

0 commit comments

Comments
 (0)