contrib/subtree: fix "subtree split" skipped-merge bug
commit933cfeb90b5d03b4096db6d60494a6eedea25d03
authorDave Ware <davidw@realtimegenomics.com>
Fri, 15 Jan 2016 00:41:43 +0000 (15 13:41 +1300)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 Jan 2016 22:53:18 +0000 (20 14:53 -0800)
treea916e337fe8deb41761d87c2219f240914239997
parent30fe9b2f9aece7f8f24bc069b9d7470b8291535e
contrib/subtree: fix "subtree split" skipped-merge bug

'git subtree split' can incorrectly skip a merge even when both parents
act on the subtree, provided the merge results in a tree identical to
one of the parents. Fix by copying the merge if at least one parent is
non-identical, and the non-identical parent is not an ancestor of the
identical parent.

Also, add a test case which checks that a descendant remains a
descendent on the subtree in this case.

Signed-off-by: Dave Ware <davidw@realtimegenomics.com>
Reviewed-by: David A. Greene <greened@obbligato.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/subtree/git-subtree.sh
contrib/subtree/t/t7900-subtree.sh