diff options
Diffstat (limited to 'git/merge.sh')
-rwxr-xr-x | git/merge.sh | 18 |
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 |