-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpre-commit
More file actions
executable file
·30 lines (25 loc) · 824 Bytes
/
pre-commit
File metadata and controls
executable file
·30 lines (25 loc) · 824 Bytes
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
#!/bin/bash
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=$(git hash-object -t tree /dev/null)
fi
# Redirect output to stderr.
exec 1>&2
if ! diff {.,./nixpkgs-config}/.github/workflows/build.yml
then
echo github workflows in the ./nixpkgs-config subtree is out of sync
exit 1
fi
# ensure that the sub-flake is synced to the parent flake
nix flake update nixpkgs-config
# # If there are whitespace errors, print the offending file names and fail.
# exec git diff-index --check --cached "$against" --