Convert stable to update.
[git-central.git] / server / update-stable
1 #!/bin/sh
2
3 # Command line
4 refname="$1"
5 oldrev="$2"
6 newrev="$3"
7
8 if expr "$oldrev" : '0*$' >/dev/null ; then
9         exit 0
10 fi
11
12 if [ "$refname" != "refs/heads/stable" ] ; then
13         exit 0
14 fi
15
16 # read backwards:
17 # - all commits from old..new
18 # - unless they were already pointed to by a branch
19 # = all new commits on stable
20 count=$(git rev-parse --not --branches | git rev-list --stdin $oldrev..$newrev | wc -l)
21 if [ "$count" -ne "0" ] ; then
22         newname=$(git rev-parse "$newrev")
23         echo "----------------------------------------------------"
24         echo
25         echo "Moving stable to $newname includes a new commit"
26         echo
27         echo "----------------------------------------------------"
28         exit 1
29 fi
30
31