subtree: fix "git subtree split --rejoin"
commit0f12c7d4d175bb0566208213b1b340b6794f305c
authorDavid Aguilar <davvid@gmail.com>
Tue, 26 Jul 2016 04:14:15 +0000 (25 21:14 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 Jul 2016 20:57:00 +0000 (26 13:57 -0700)
tree0974c3fb730d714476b5b50704fe129c1f2fb7b7
parentfbd3199a6d8c6b3fd1e9aa0034cee9a0c6a9bfb4
subtree: fix "git subtree split --rejoin"

"git merge" in v2.9 prevents merging unrelated histories.

"git subtree split --rejoin" creates unrelated histories when
creating a split repo from a raw sub-directory that did not
originate from an invocation of "git subtree add".

Restore the original behavior by passing --allow-unrelated-histories
when merging subtrees.  This ensures that the synthetic history
created by "git subtree split" can be merged.

Add a test to ensure that this feature works as advertised.

Reported-by: Brett Cundal <brett.cundal@iugome.com>
Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/subtree/git-subtree.sh
contrib/subtree/t/t7900-subtree.sh