From 5169947531cfe1049ca5ca2f918dbf9b453a1c54 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 25 Nov 2024 16:26:38 +0100 Subject: [PATCH] feat!: replace `tree::Options::allow_lossy_resolution` with `*::tree_conflicts`. That way it's possible to steer how to resolve tree-related conflicts while making it possible to detect that a conflict happened. --- .../generated-archives/tree-baseline.tar | Bin 2840576 -> 2910208 bytes gix-merge/tests/fixtures/tree-baseline.sh | 22 +++++++++++++++- gix-merge/tests/merge/tree/mod.rs | 24 +++++------------- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/gix-merge/tests/fixtures/generated-archives/tree-baseline.tar b/gix-merge/tests/fixtures/generated-archives/tree-baseline.tar index 325533a59a83b71145d73e245f284b601995841b..4c6bfb8f4a25c4f50895864d061f00d0cfd149ae 100644 GIT binary patch delta 8760 zcmd5?2~<HiL~sD7)&aDjI8;D$ zu~tPZPOmCe%dHk?Yb#dmz_a?Q{Lb@;6ZYrnJLldDM4#CY(>c+}5Nog9pX$2r z*x7CVV( zwW#s5g5ZZ`8!7&>jWnO|v_i)(J{SP`kkb4+_`2DgB%$qxwVMZ}&*?gM-`M%@Jk&bA zIf6ZgiasqW$c>=J!-Mew}Z16ZqsmHIb#Fb0A7Rcn4RgZ&ANNMKJc-~U(SmEcZ zGh^zS3Jj8(eu~8@50>iJ7c7A4@ep?fS5d5RbHT@(P`EqX`6je)RchCb8y^9rR6TMl zm_j-`l))&tgWtCy5%|CqpU9x<=IQtEb^6|LSg^llqkVku!^1)d{wmFE#9iqVj*C;g z`jmai#xu6dwZ+TRe2C>~zIh1Pq*Xe;HV#0Ol!88g16SI7dy~x3IeSSapfvL){sGMl zN%7J_CZsg;7&L7Z{>>;k|frGPIT!<7yE1YumS8FO}(YQVQjIXIyzxFjjcKyvwdAY16Hv_X_VNj@VMU`=|K< z5M>PFejht}pa z+3il7(~O~divhFPQI}QGTVZ#ZoG7M69TrUMbXaX>n;xv^G+9g*tKMmMnXOLLskiEI zYl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1i%E#eo+2(hXyZn)cqQQa_%u zPFsFlU;K&6N;~7Odj=k?5~F?zpwLW9`@wUVV_omE+V#cO%uUG=+rU}Csm+DzI?|H zR5G!$zR?DJwB;U`v%6ylooK$@e|X8x+{khDCrW`#B*CRiN6?QcST1f-jP$1N*@Zz1L05`uzY{ikHA@O;;~McujG;hq^E zeQshV{E7`vhoJov z87&(F^MjSmPZDg_(S2V1`q+xQ7N@4GQ7~!$-`1}FlY#Ids0eqJ^39foo @@ -993,7 +1013,7 @@ git init type-change-to-symlink -# TODO: Git does not detect the conflict (one turns exe off, the other turns it on), and we do exactly the same. +baseline rename-add-same-symlink A-B A B baseline rename-add-exe-bit-conflict A-B A B baseline remove-executable-mode A-B A B baseline simple side-1-3-without-conflict side1 side3 diff --git a/gix-merge/tests/merge/tree/mod.rs b/gix-merge/tests/merge/tree/mod.rs index 662bcc67998..1e6ea2d6b1f 100644 --- a/gix-merge/tests/merge/tree/mod.rs +++ b/gix-merge/tests/merge/tree/mod.rs @@ -130,27 +130,15 @@ fn run_baseline() -> crate::Result { actual.conflicts, merge_info.conflicts ); - // if case_name.starts_with("submodule-both-modify-A-B") { - if false { - assert!( - !did_change, - "{case_name}: We can't handle submodules, so there is no index change" - ); - assert!( - actual.has_unresolved_conflicts(conflicts_like_in_git), - "{case_name}: submodules currently result in an unresolved (unknown) conflict" - ); - } else { - assert_eq!( - did_change, - actual.has_unresolved_conflicts(conflicts_like_in_git), - "{case_name}: If there is any kind of conflict, the index should have been changed" - ); - } + assert_eq!( + did_change, + actual.has_unresolved_conflicts(conflicts_like_in_git), + "{case_name}: If there is any kind of conflict, the index should have been changed" + ); } assert_eq!( - actual_cases, 107, + actual_cases, 109, "BUG: update this number, and don't forget to remove a filter in the end" );