@@ -16,34 +16,44 @@ public string FilePath
1616 get => _filePath ;
1717 }
1818
19+ public object Mine
20+ {
21+ get ;
22+ }
23+
24+ public object Theirs
25+ {
26+ get ;
27+ }
28+
1929 public string Error
2030 {
2131 get => _error ;
2232 private set => SetProperty ( ref _error , value ) ;
2333 }
2434
25- public List < Models . ConflictLine > OursDiffLines
35+ public List < Models . ConflictLine > OursLines
2636 {
27- get => _oursDiffLines ;
28- private set => SetProperty ( ref _oursDiffLines , value ) ;
37+ get => _oursLines ;
38+ private set => SetProperty ( ref _oursLines , value ) ;
2939 }
3040
31- public List < Models . ConflictLine > TheirsDiffLines
41+ public List < Models . ConflictLine > TheirsLines
3242 {
33- get => _theirsDiffLines ;
34- private set => SetProperty ( ref _theirsDiffLines , value ) ;
43+ get => _theirsLines ;
44+ private set => SetProperty ( ref _theirsLines , value ) ;
3545 }
3646
37- public List < Models . ConflictLine > ResultDiffLines
47+ public List < Models . ConflictLine > ResultLines
3848 {
39- get => _resultDiffLines ;
40- private set => SetProperty ( ref _resultDiffLines , value ) ;
49+ get => _resultLines ;
50+ private set => SetProperty ( ref _resultLines , value ) ;
4151 }
4252
43- public int DiffMaxLineNumber
53+ public int MaxLineNumber
4454 {
45- get => _diffMaxLineNumber ;
46- private set => SetProperty ( ref _diffMaxLineNumber , value ) ;
55+ get => _maxLineNumber ;
56+ private set => SetProperty ( ref _maxLineNumber , value ) ;
4757 }
4858
4959 public int UnsolvedCount
@@ -69,11 +79,20 @@ public IReadOnlyList<Models.ConflictRegion> ConflictRegions
6979 get => _conflictRegions ;
7080 }
7181
72- public MergeConflictEditor ( Repository repo , string filePath )
82+ public MergeConflictEditor ( Repository repo , Models . Commit head , string filePath )
7383 {
7484 _repo = repo ;
7585 _filePath = filePath ;
7686
87+ ( Mine , Theirs ) = repo . InProgressContext switch
88+ {
89+ CherryPickInProgress cherryPick => ( head , cherryPick . Head ) ,
90+ RebaseInProgress rebase => ( rebase . Onto , rebase . StoppedAt ) ,
91+ RevertInProgress revert => ( head , revert . Head ) ,
92+ MergeInProgress merge => ( head , merge . Source ) ,
93+ _ => ( head , ( object ) "Stash or Patch" ) ,
94+ } ;
95+
7796 var workingCopyPath = Path . Combine ( _repo . FullPath , _filePath ) ;
7897 var workingCopyContent = string . Empty ;
7998 if ( File . Exists ( workingCopyPath ) )
@@ -291,28 +310,27 @@ private void ParseOriginalContent(string content)
291310 }
292311 }
293312
294- var maxLineNumber = Math . Max ( oursLineNumber , theirsLineNumber ) ;
295- DiffMaxLineNumber = maxLineNumber ;
296- OursDiffLines = oursLines ;
297- TheirsDiffLines = theirsLines ;
313+ MaxLineNumber = Math . Max ( oursLineNumber , theirsLineNumber ) ;
314+ OursLines = oursLines ;
315+ TheirsLines = theirsLines ;
298316 }
299317
300318 private void RefreshDisplayData ( )
301319 {
302320 var resultLines = new List < Models . ConflictLine > ( ) ;
303321 _lineStates . Clear ( ) ;
304322
305- if ( _oursDiffLines == null || _oursDiffLines . Count == 0 )
323+ if ( _oursLines == null || _oursLines . Count == 0 )
306324 {
307- ResultDiffLines = resultLines ;
325+ ResultLines = resultLines ;
308326 return ;
309327 }
310328
311329 int resultLineNumber = 1 ;
312330 int currentLine = 0 ;
313331 int conflictIdx = 0 ;
314332
315- while ( currentLine < _oursDiffLines . Count )
333+ while ( currentLine < _oursLines . Count )
316334 {
317335 // Check if we're at a conflict region
318336 Models . ConflictRegion currentRegion = null ;
@@ -424,7 +442,7 @@ private void RefreshDisplayData()
424442 }
425443 else
426444 {
427- var oursLine = _oursDiffLines [ currentLine ] ;
445+ var oursLine = _oursLines [ currentLine ] ;
428446 resultLines . Add ( new ( oursLine . Type , oursLine . Content , resultLineNumber ) ) ;
429447 _lineStates . Add ( Models . ConflictLineState . Normal ) ;
430448 resultLineNumber ++ ;
@@ -433,7 +451,7 @@ private void RefreshDisplayData()
433451 }
434452
435453 SelectedChunk = null ;
436- ResultDiffLines = resultLines ;
454+ ResultLines = resultLines ;
437455
438456 var unsolved = new List < int > ( ) ;
439457 for ( var i = 0 ; i < _conflictRegions . Count ; i ++ )
@@ -450,10 +468,10 @@ private void RefreshDisplayData()
450468 private readonly string _filePath ;
451469 private string _originalContent = string . Empty ;
452470 private int _unsolvedCount = 0 ;
453- private int _diffMaxLineNumber = 0 ;
454- private List < Models . ConflictLine > _oursDiffLines = [ ] ;
455- private List < Models . ConflictLine > _theirsDiffLines = [ ] ;
456- private List < Models . ConflictLine > _resultDiffLines = [ ] ;
471+ private int _maxLineNumber = 0 ;
472+ private List < Models . ConflictLine > _oursLines = [ ] ;
473+ private List < Models . ConflictLine > _theirsLines = [ ] ;
474+ private List < Models . ConflictLine > _resultLines = [ ] ;
457475 private List < Models . ConflictRegion > _conflictRegions = [ ] ;
458476 private List < Models . ConflictLineState > _lineStates = [ ] ;
459477 private Vector _scrollOffset = Vector . Zero ;
0 commit comments