-
Notifications
You must be signed in to change notification settings - Fork 1
/
pre-receive
executable file
·46 lines (37 loc) · 1.38 KB
/
pre-receive
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
source ./hooks/config
retcode=1;
while read old_sha1 new_sha1 refname; do
# echo "-----pre (${WHO_AM_I}) -----";
# echo "ns : " $new_sha1;
# echo "os : " $old_sha1;
# echo "ref: " $refname;
# echo "----"
# use a special "sync" branch (via the $refname) - which
# would only exist on the sync machines - which we'd 'merge --ff'
if [ "$refname" = "refs/heads/master" ]
then
# accuire locks on all remote repos
for l in $LOCK_ORG
do
# not currently implemented
# echo "Acquire lock ${l}"
# echo " Adding ${new_sha1} to accept list"
echo "Locking isn't currently implemented"
done
retcode=0;
else
if [ "$refname" = "refs/heads/sync" ]
then
# this is actuall a sync coming in!!
# echo "Check we're locked..."
# echo "Check ${new_sha1} is in the accept list"
retcode=0;
else
# any other branch - don't do anything
# but allow it to pass
retcode=0;
fi
fi
done
exit $retcode