Merge branch 'dw/subtree-split-do-not-drop-merge'

The "split" subcommand of "git subtree" (in contrib/) incorrectly
skipped merges when it shouldn't, which was corrected.

* dw/subtree-split-do-not-drop-merge:
  contrib/subtree: fix "subtree split" skipped-merge bug
This commit is contained in:
Junio C Hamano
2016-02-03 14:16:03 -08:00
2 changed files with 70 additions and 2 deletions

View File

@ -485,8 +485,16 @@ copy_or_skip()
p="$p -p $parent"
fi
done
if [ -n "$identical" ]; then
copycommit=
if [ -n "$identical" ] && [ -n "$nonidentical" ]; then
extras=$(git rev-list --count $identical..$nonidentical)
if [ "$extras" -ne 0 ]; then
# we need to preserve history along the other branch
copycommit=1
fi
fi
if [ -n "$identical" ] && [ -z "$copycommit" ]; then
echo $identical
else
copy_commit $rev $tree "$p" || exit $?