File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,26 @@ pub mod tree {
133
133
pub fn has_unresolved_conflicts ( & self , how : TreatAsUnresolved ) -> bool {
134
134
self . conflicts . iter ( ) . any ( |c| c. is_unresolved ( how) )
135
135
}
136
+
137
+ /// Returns `true` if `index` changed as we applied conflicting stages to it, using `how` to determine if a
138
+ /// conflict should be considered unresolved.
139
+ /// It's important that `index` is at the state of [`Self::tree`].
140
+ ///
141
+ /// Note that in practice, whenever there is a single [conflict](Conflict), this function will return `true`.
142
+ ///
143
+ /// ### Important
144
+ ///
145
+ /// Also, the unconflicted stage of such entries will be removed merely by setting a flag, so the
146
+ /// in-memory entry is still present.
147
+ /// One can prune `index` [in-memory](gix_index::State::remove_entries()) or write it to disk, which will
148
+ /// cause entries marked for removal not to be persisted.
149
+ pub fn index_changed_after_applying_conflicts (
150
+ & self ,
151
+ index : & mut gix_index:: State ,
152
+ how : TreatAsUnresolved ,
153
+ ) -> bool {
154
+ gix_merge:: tree:: apply_index_entries ( & self . conflicts , how, index)
155
+ }
136
156
}
137
157
138
158
/// A way to configure [`Repository::merge_trees()`](crate::Repository::merge_trees()).
You can’t perform that action at this time.
0 commit comments