aboutsummaryrefslogtreecommitdiff
path: root/bdep-util/git-hooks/pre-commit.in
blob: 33391870ca29f0b958963c3a075e060547709188 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /usr/bin/env bash

# file      : bdep-util/git-hooks/pre-commit.in
# license   : MIT; see accompanying LICENSE file

# Forward the execution to the pre-commit script implementation.
#
# To enable the hooks globally run, for example:
#
# $ git config --global core.hooksPath /usr/local/bin/bdep-git-hooks
#
# Notes:
#
# - git passes no parameters to this kind of hooks.
#
# - git changes CWD to the git repository root directory for the hook process.
#
# - git command running from inside the hook sees files that should be
#   auto-staged due to the -a git-commit option or similar as already staged.
#
trap 'exit 1' ERR

source "$(dirname "$(realpath "${BASH_SOURCE[0]}")")/../bdep-git-pre-commit"