Skip to content

Commit f803551

Browse files
committed
fix: Repository::tree_merge_options() now comes with rewrite tracking.
This is the way Git acts, as it's either configured, or defaults to the value coming from the `diff.renames` configuration.
1 parent c82fc39 commit f803551

File tree

5 files changed

+107
-257
lines changed

5 files changed

+107
-257
lines changed

gix/src/diff.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pub(crate) mod utils {
175175
new_rewrites_inner(config, lenient, &Diff::RENAMES, &Diff::RENAME_LIMIT)
176176
}
177177

178-
pub fn new_rewrites_inner(
178+
pub(crate) fn new_rewrites_inner(
179179
config: &gix_config::File<'static>,
180180
lenient: bool,
181181
renames: &'static crate::config::tree::diff::Renames,

gix/src/repository/merge.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ impl Repository {
9494
self.config.lenient_config,
9595
&tree::Merge::RENAMES,
9696
&tree::Merge::RENAME_LIMIT,
97-
)?,
97+
)?
98+
.map(Ok)
99+
.or_else(|| crate::diff::utils::new_rewrites(&self.config.resolved, self.config.lenient_config).transpose())
100+
.transpose()?
101+
.unwrap_or_default()
102+
.into(),
98103
blob_merge: self.blob_merge_options()?,
99104
blob_merge_command_ctx: self.command_context()?,
100105
fail_on_conflict: None,

0 commit comments

Comments
 (0)