From 60cd210b80a7779f0b3a66ddb768e9b441ac8d52 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 30 May 2025 11:13:29 +0800 Subject: [PATCH] fix: using `theirs` or `mine` does not work if it is deleted by ours or theirs Signed-off-by: leo --- src/ViewModels/WorkingCopy.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs index eb0e1e51..146ea81d 100644 --- a/src/ViewModels/WorkingCopy.cs +++ b/src/ViewModels/WorkingCopy.cs @@ -388,7 +388,8 @@ namespace SourceGit.ViewModels if (!change.IsConflicted) continue; - if (change.WorkTree == Models.ChangeState.Deleted) + if (change.ConflictReason == Models.ConflictReason.BothDeleted || + change.ConflictReason == Models.ConflictReason.DeletedByThem) { var fullpath = Path.Combine(_repo.FullPath, change.Path); if (File.Exists(fullpath)) @@ -430,7 +431,8 @@ namespace SourceGit.ViewModels if (!change.IsConflicted) continue; - if (change.Index == Models.ChangeState.Deleted) + if (change.ConflictReason == Models.ConflictReason.BothDeleted || + change.ConflictReason == Models.ConflictReason.DeletedByUs) { var fullpath = Path.Combine(_repo.FullPath, change.Path); if (File.Exists(fullpath))