blob: 4412f9f5b8f981e73b9f0c7862b089ae619937b0 (
plain)
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
|
#!/bin/sh
. settings.sh
echo "Checking repository. Please wait..."
cd "$REPO" >/dev/null
git push origin master 2>/dev/null
# check if remote is up to date
git fetch git@git.spline.de:bcfg2-repository
if [ -n "$(git rev-list HEAD..FETCH_HEAD)" ]; then
error "$REPO: HEAD does not equal to origin/master."
fi
if ! $BINDIR/check-repo; then
error "$REPO: bcfg2-lint detected errors."
fi
echo "All checks passed. Updating real repository..."
# update real repository
cd "$REAL" >/dev/null
if ! git remote update --prune >/dev/null 2>&1; then
error "$REAL: git remote update --prune failed"
fi
git fetch --quiet --tags 2>/dev/null ||
error "$REAL: git fetch failed."
git checkout --quiet --force master ||
error "$REAL: git checkout failed."
git reset --quiet --hard origin/master ||
error "$REAL: git reset failed."
git clean --quiet --force -d ||
error "$REAL: git clean failed"
echo "All done."
cd "$OLDPWD" >/dev/null
|