diff --git a/checkout.sh b/checkout.sh new file mode 100755 index 00000000000..f868c942a7d --- /dev/null +++ b/checkout.sh @@ -0,0 +1,98 @@ +#/bin/sh +set -e + +ODOO=https://github.com/odoo/odoo.git +DEV=https://github.com/odoo-dev/odoo.git + +usage () { +cat < .git/hooks/pre-push +#!/bin/sh +remote="\$1" +url="\$2" + +if [ "\$url" != "$ODOO" ] +then + exit 0 +fi + +echo "Pushing to the odoo remote ($ODOO) is forbidden, push to the dev remote" +echo +echo "See git help push if you really want to push to odoo" +exit 1 + +EOF +chmod +x .git/hooks/pre-push + +# add basic repos as remotes +git remote add odoo $ODOO +git remote add dev $DEV + +if [ $include_merge ] +then + git remote add merge $ODOO + git config remote.merge.fetch '+refs/pull/*/merge:refs/remotes/merge/*' +fi + +echo +git remote update + +exit 0