@@ -118,19 +118,14 @@ impl TryFrom<gix::Commit<'_>> for Commit {
118118 let commit_id = commit. id ;
119119 let commit = commit. decode ( ) ?;
120120 let headers = but_core:: commit:: Headers :: try_from_commit_headers ( || commit. extra_headers ( ) ) ;
121- let has_conflicts = but_core:: commit:: message_is_conflicted ( commit. message )
122- || headers. as_ref ( ) . is_some_and ( |hdr| hdr. is_conflicted ( ) ) ;
121+ let has_conflicts = but_core:: commit:: is_conflicted ( commit. message , headers. as_ref ( ) ) ;
123122 let change_id = headers
124123 . unwrap_or_default ( )
125124 . ensure_change_id ( commit_id)
126125 . change_id
127126 . expect ( "change-id is ensured" )
128127 . to_string ( ) ;
129- let message = if has_conflicts {
130- but_core:: commit:: strip_conflict_markers ( commit. message )
131- } else {
132- commit. message . to_owned ( )
133- } ;
128+ let message = but_core:: commit:: strip_conflict_markers ( commit. message ) ;
134129 Ok ( Commit {
135130 id : commit_id,
136131 parent_ids : commit. parents ( ) . collect ( ) ,
@@ -148,8 +143,8 @@ impl TryFrom<gix::Commit<'_>> for Commit {
148143impl From < but_core:: CommitOwned > for Commit {
149144 fn from ( CommitOwned { id, inner } : CommitOwned ) -> Self {
150145 let headers = commit:: Headers :: try_from_commit ( & inner) ;
151- let has_conflicts = but_core :: commit :: message_is_conflicted ( inner . message . as_ref ( ) )
152- || headers . as_ref ( ) . is_some_and ( |hdr| hdr . is_conflicted ( ) ) ;
146+ let has_conflicts =
147+ but_core :: commit :: is_conflicted ( inner . message . as_ref ( ) , headers . as_ref ( ) ) ;
153148 let change_id = headers
154149 . unwrap_or_default ( )
155150 . ensure_change_id ( id)
@@ -165,11 +160,7 @@ impl From<but_core::CommitOwned> for Commit {
165160 message,
166161 extra_headers : _,
167162 } = inner;
168- let message = if has_conflicts {
169- but_core:: commit:: strip_conflict_markers ( message. as_ref ( ) )
170- } else {
171- message
172- } ;
163+ let message = but_core:: commit:: strip_conflict_markers ( message. as_ref ( ) ) ;
173164 Commit {
174165 id,
175166 parent_ids : parents. into_iter ( ) . collect ( ) ,
0 commit comments