7 REPO_DIR
="/home/repo/repo"
8 LOCK_FILE
="/tmp/updateweb-$cfg_tmpsuffix.lock"
12 # Make sure we don't run twice.
13 if [ -s "$LOCK_FILE" ] && kill -0 "$(cat "$LOCK_FILE")" 2>/dev
/null
; then
14 echo "Already running updateweb.sh (stuck?) with pid $(cat "$LOCK_FILE")" >&2
17 trap 'rm -f "$LOCK_FILE"' EXIT
23 git_add_config
"gc.autodetach=false"
25 if [ -n "$(git rev-list $BRANCH..$REMOTE/$BRANCH)" ]; then
26 case "$(git describe --always --dirty=..dirty)" in *..dirty
)
27 echo "updateweb.sh: refusing to update because worktree is dirty" >&2
31 git merge
--ff-only "$REMOTE/$BRANCH" &&
32 git submodule update
--init --recursive &&