git-subtree: Bail out if we find output from Rust rewrite (test)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ian Jackson committed
Jul 6, 2026 at 12:58 UTC
20b117c1eb19c0e08ede3c7285c991eac4c9345f
1 file changed
+18
contrib/subtree/t/t7900-subtree.sh
+18
@@ -439,6 +439,24 @@ test_expect_success 'split sub dir/ with --rejoin' '
439
)
440
'
441
442
+test_expect_success 'split fail on RIIR git subtree data' '
443
+ subtree_test_create_repo "$test_count" &&
444
+ subtree_test_create_repo "$test_count/sub proj" &&
445
+ test_create_commit "$test_count" main1 &&
446
+ test_create_commit "$test_count/sub proj" sub1 &&
447
+ (
448
+ cd "$test_count" &&
449
+ git fetch ./"sub proj" HEAD &&
450
+ git subtree add --prefix="sub dir" FETCH_HEAD &&
451
+ # simulate RIIR git-subtree generated data
452
+ mkdir .git-subtree &&
453
+ echo "# sabotage" >.git-subtree/config &&
454
+ git add .git-subtree/config &&
455
+ git commit -m sabotage &&
456
+ test_must_fail git subtree split -P "sub dir" HEAD
457
+ )
458
+'
459
+
460
# Tests that commits from other subtrees are not processed as
461
# part of a split.
462
#