summaryrefslogtreecommitdiff
path: root/contrib/subtree/git-subtree.sh
diff options
context:
space:
mode:
authorLibravatar David Aguilar <davvid@gmail.com>2016-07-25 21:14:15 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-07-26 13:57:00 -0700
commit0f12c7d4d175bb0566208213b1b340b6794f305c (patch)
tree0974c3fb730d714476b5b50704fe129c1f2fb7b7 /contrib/subtree/git-subtree.sh
parentt7900-subtree.sh: fix quoting and broken && chains (diff)
downloadtgif-0f12c7d4d175bb0566208213b1b340b6794f305c.tar.xz
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>
Diffstat (limited to 'contrib/subtree/git-subtree.sh')
-rwxr-xr-xcontrib/subtree/git-subtree.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 7a39b30ad0..b567eaeff9 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -662,6 +662,7 @@ cmd_split()
debug "Merging split branch into HEAD..."
latest_old=$(cache_get latest_old)
git merge -s ours \
+ --allow-unrelated-histories \
-m "$(rejoin_msg "$dir" $latest_old $latest_new)" \
$latest_new >&2 || exit $?
fi