summaryrefslogtreecommitdiff
path: root/t/t6029-merge-subtree.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-08-17 13:09:55 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-08-17 13:09:55 -0700
commit60858f343aa909305c28790c7684bf88905695a2 (patch)
treea49486fea05a68d019262140c24e63483a1affcc /t/t6029-merge-subtree.sh
parentMerge branch 'ab/test-must-be-empty' (diff)
parentscore_trees(): fix iteration over trees with missing entries (diff)
downloadtgif-60858f343aa909305c28790c7684bf88905695a2.tar.xz
Merge branch 'jk/merge-subtree-heuristics'
The automatic tree-matching in "git merge -s subtree" was broken 5 years ago and nobody has noticed since then, which is now fixed. * jk/merge-subtree-heuristics: score_trees(): fix iteration over trees with missing entries
Diffstat (limited to 't/t6029-merge-subtree.sh')
-rwxr-xr-xt/t6029-merge-subtree.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t6029-merge-subtree.sh b/t/t6029-merge-subtree.sh
index 7d5bc78472..793f0c8bf3 100755
--- a/t/t6029-merge-subtree.sh
+++ b/t/t6029-merge-subtree.sh
@@ -29,6 +29,34 @@ test_expect_success 'subtree available and works like recursive' '
'
+test_expect_success 'setup branch sub' '
+ git checkout --orphan sub &&
+ git rm -rf . &&
+ test_commit foo
+'
+
+test_expect_success 'setup branch main' '
+ git checkout -b main master &&
+ git merge -s ours --no-commit --allow-unrelated-histories sub &&
+ git read-tree --prefix=dir/ -u sub &&
+ git commit -m "initial merge of sub into main" &&
+ test_path_is_file dir/foo.t &&
+ test_path_is_file hello
+'
+
+test_expect_success 'update branch sub' '
+ git checkout sub &&
+ test_commit bar
+'
+
+test_expect_success 'update branch main' '
+ git checkout main &&
+ git merge -s subtree sub -m "second merge of sub into main" &&
+ test_path_is_file dir/bar.t &&
+ test_path_is_file dir/foo.t &&
+ test_path_is_file hello
+'
+
test_expect_success 'setup' '
mkdir git-gui &&
cd git-gui &&