@@ -33,13 +33,13 @@ pub struct IndexConflicts<'index> {
33
33
/// A structure to represent the information returned when a conflict is detected in an index entry
34
34
pub struct IndexConflict {
35
35
/// The ancestor index entry of the two conflicting index entries
36
- pub ancestor : IndexEntry ,
36
+ pub ancestor : Option < IndexEntry > ,
37
37
/// The index entry originating from the user's copy of the repository.
38
38
/// Its contents conflict with 'their' index entry
39
- pub our : IndexEntry ,
39
+ pub our : Option < IndexEntry > ,
40
40
/// The index entry originating from the external repository.
41
41
/// Its contents conflict with 'our' index entry
42
- pub their : IndexEntry ,
42
+ pub their : Option < IndexEntry > ,
43
43
}
44
44
45
45
/// A callback function to filter index matches.
@@ -588,9 +588,18 @@ impl<'index> Iterator for IndexConflicts<'index> {
588
588
self . conflict_iter
589
589
) ) ;
590
590
Some ( Ok ( IndexConflict {
591
- ancestor : IndexEntry :: from_raw ( * ancestor) ,
592
- our : IndexEntry :: from_raw ( * our) ,
593
- their : IndexEntry :: from_raw ( * their) ,
591
+ ancestor : match ancestor. is_null ( ) {
592
+ false => Some ( IndexEntry :: from_raw ( * ancestor) ) ,
593
+ true => None ,
594
+ } ,
595
+ our : match our. is_null ( ) {
596
+ false => Some ( IndexEntry :: from_raw ( * our) ) ,
597
+ true => None ,
598
+ } ,
599
+ their : match their. is_null ( ) {
600
+ false => Some ( IndexEntry :: from_raw ( * their) ) ,
601
+ true => None ,
602
+ } ,
594
603
} ) )
595
604
}
596
605
}
0 commit comments