summaryrefslogtreecommitdiffstats
path: root/modules/tozt/files/post-receive
blob: 9d909a4174403b91c6494d6b9ba4b849f6657ca2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
set -eu
set -o pipefail

mkdir -p info/web
git for-each-ref --sort=committerdate --format='%(committerdate)' refs/heads | tail -n1 > info/web/last-modified

# XXX github accepts pushes of things under refs/remotes (and presumably just
# ignores them), but gitlab throws an error when you do this. as far as i can
# tell though, --mirror is the only way to keep the list of branches in sync
# (like, delete remote branches when the local branch is deleted, etc), and
# there's no way to configure the set of refs when using --mirror, so this is
# probably the best i can do for now
rm -rf refs/remotes
git push --mirror gitlab
git push --mirror github