Skip to content

Commit 42734b9

Browse files
committed
fix: staged files do not update after committing with --amend enabled successfully (#2253)
This issue is introduced by commit 26fc29b. And the right way to fix this issue is to force `Command.Commit` finish in UI thread. Signed-off-by: leo <longshuang@msn.cn>
1 parent a3c0b22 commit 42734b9

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/ViewModels/WorkingCopy.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -665,18 +665,15 @@ public async Task CommitAsync(bool autoStage, bool autoPush)
665665
var log = _repo.CreateLog("Commit");
666666
var succ = await new Commands.Commit(_repo.FullPath, _commitMessage, EnableSignOff, NoVerifyOnCommit, _useAmend, _resetAuthor)
667667
.Use(log)
668-
.RunAsync()
669-
.ConfigureAwait(false);
668+
.RunAsync();
670669

671670
log.Complete();
672671

673672
if (succ)
674673
{
675-
// Do not use property `UseAmend` but manually trigger property changed to avoid refreshing staged changes here.
676-
_useAmend = false;
677-
OnPropertyChanged(nameof(UseAmend));
678-
674+
UseAmend = false;
679675
CommitMessage = string.Empty;
676+
680677
if (autoPush && _repo.Remotes.Count > 0)
681678
{
682679
Models.Branch pushBranch = null;

0 commit comments

Comments
 (0)