1
0
Fork 0
scripts-admin-quickndirty-p.../hooks-git/website-cracra/pre-receive

14 lines
410 B
Bash
Executable file

#!/bin/sh
# Stop on the first error
set -ex
export GIT_WORK_TREE=$GIT_DIR/..
# Check for diff between the index and the staging area
git diff-index --quiet --cached HEAD --
# Check for diff between the working tree and the staging area
git diff-files --quiet
# No abandoned files
test -z "$( cd "$GIT_WORK_TREE" && GIT_WORK_TREE="$PWD" GIT_DIR="$GIT_WORK_TREE/.git" git --git-dir=.git ls-files --others )"