Remove redundant LENGTH calls in NSUBSTITUTE[-IF[-NOT]]
[sbcl.git] / git / update
blobc7e449a81fcd9f54a3b460418ac1d80131b62437
1 #!/bin/sh
3 # --- Command line
4 refname="$1"
5 oldrev="$2"
6 newrev="$3"
8 # --- Safety check
9 if [ -z "$GIT_DIR" ]; then
10 echo "Don't run this script from the command line." >&2
11 echo " (if you want, you could supply GIT_DIR then run" >&2
12 echo " $0 <ref> <oldrev> <newrev>)" >&2
13 exit 1
16 if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
17 echo "Usage: $0 <ref> <oldrev> <newrev>" >&2
18 exit 1
21 # Don't allow merge commits on master
22 if [ "$refname" = "refs/heads/master" ]
23 then
24 for rev in $(git rev-list $newrev --not $oldrev)
26 echo -n "Checking: $rev"
27 if git rev-parse --verify --quiet $rev^2 > /dev/null
28 then
29 echo " (merge!)"
30 echo
31 echo "Merges not allowed on master. Rebase your changes instead."
32 echo
33 exit 1
34 else
35 echo " (ok)"
37 done