Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ if [ ! -z "$hook_symlink" ]; then
subhook_root="$(dirname $hook_symlink)/commit_hooks"
fi

# If using submodules, we need to read proper subhook root
if [ -f "$git_root/.git" ]; then
IFS=": "
while read -r name value
do
if [ $name == "gitdir" ]; then
submodule_hookdir=$value
fi
done < "$git_root/.git"
if [ ! -z "$submodule_hookdir" ]; then
subhook_root="$git_root/$submodule_hookdir/hooks/commit_hooks"
fi
fi

for changedfile in `git diff --cached --name-only --diff-filter=ACM`; do
#check puppet manifest syntax
if type puppet >/dev/null 2>&1; then
Expand Down