File tree 2 files changed +21
-0
lines changed 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -353,6 +353,7 @@ Check out the [performance discussion][gix-diff-performance] as well.
353
353
* [x] ** tree** -diff-heuristics match Git for its test-cases
354
354
- [x] a way to generate an index with stages, mostly conforming with Git.
355
355
- [ ] submodule merges (* right now they count as conflicts if they differ* )
356
+ - [ ] assure sparse indices are handled correctly during application - right now we refuse.
356
357
* [x] ** commits** - with handling of multiple merge bases by recursive merge-base merge
357
358
* [x] API documentation
358
359
* [ ] Examples
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