summaryrefslogtreecommitdiff
path: root/git
diff options
context:
space:
mode:
Diffstat (limited to 'git')
-rwxr-xr-xgit/merge.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/git/merge.sh b/git/merge.sh
index 4f12f8c..34da466 100755
--- a/git/merge.sh
+++ b/git/merge.sh
@@ -15,6 +15,22 @@ fi
for i in $modules; do
echo "merge $i" 1>&2
cd $i
- git merge $*
+
+ br=`git symbolic-ref -q HEAD`
+ br=`echo $br | sed -e 's%^refs/heads/%%'`
+
+ # Only allow fast-forward merges into master.
+ #
+ if [ "$br" = "master" ]; then
+ git merge --ff-only $*
+ else
+ git merge $*
+ fi
+
+ if [ $? -ne 0 ]; then
+ echo "merge FAILED" 1>&2
+ exit 1
+ fi
+
cd $wd
done