update-third-party: support Git 2.9.0's new merge restrictions
Use the `--allow-unrelated-histories` flag to declare that we Know What We're Doing™ (but only if necessary).
This commit is contained in:
parent
86f1d70445
commit
dcb2e39fda
|
@ -155,8 +155,14 @@ popd
|
||||||
if [ -n "$basehash" ]; then
|
if [ -n "$basehash" ]; then
|
||||||
git merge --log -s recursive "-Xsubtree=$subtree/" --no-commit "upstream-$name"
|
git merge --log -s recursive "-Xsubtree=$subtree/" --no-commit "upstream-$name"
|
||||||
else
|
else
|
||||||
|
unrelated_histories_flag=""
|
||||||
|
if git merge --help | grep -q -e allow-unrelated-histories; then
|
||||||
|
unrelated_histories_flag="--allow-unrelated-histories "
|
||||||
|
fi
|
||||||
|
readonly unrelated_histories_flag
|
||||||
|
|
||||||
git fetch "$extractdir" "upstream-$name:upstream-$name"
|
git fetch "$extractdir" "upstream-$name:upstream-$name"
|
||||||
git merge --log -s ours --no-commit "upstream-$name"
|
git merge --log -s ours --no-commit $unrelated_histories_flag "upstream-$name"
|
||||||
git read-tree -u --prefix="$subtree/" "upstream-$name"
|
git read-tree -u --prefix="$subtree/" "upstream-$name"
|
||||||
fi
|
fi
|
||||||
git commit --no-edit
|
git commit --no-edit
|
||||||
|
|
Loading…
Reference in New Issue