Skip to content

Commit 2809fbb

Browse files
committed
ci: prevent file with merge conflicts
1 parent 49c9ecc commit 2809fbb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.husky/pre-commit

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
#!/bin/sh
2+
if git rev-parse --verify HEAD >/dev/null 2>&1
3+
then
4+
against=HEAD
5+
else
6+
# Initial commit: diff against an empty tree object
7+
against=$(git hash-object -t tree /dev/null)
8+
fi
9+
10+
exec git diff-index --check --cached $against --
11+
212
. "$(dirname "$0")/_/husky.sh"
313

414
npx lint-staged

0 commit comments

Comments
 (0)