summary refs log tree commit diff
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2023-01-17 16:47:04 -0600
committerStarfall <us@starfall.systems>2023-01-17 16:47:04 -0600
commit21b5e15f55c3894806a89324c832ca0b7e8c0797 (patch)
treed5bed836e9373d1e6a893691ebd5d10f81a10792
parentb261f5de0cb96e164fd9931c5f1c5a532566e457 (diff)
pre-commit-hook: default pre commit hook to avoid commiting unmerged files
-rwxr-xr-xpre-commit-hook9
1 files changed, 9 insertions, 0 deletions
diff --git a/pre-commit-hook b/pre-commit-hook
new file mode 100755
index 0000000..fa79d73
--- /dev/null
+++ b/pre-commit-hook
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+if git grep --cached -I -e '<<<<<<<' -e '>>>>>>>' > /dev/null; then
+	echo 'Cowardly refusing to commit with unresolved merges'
+	exit 1
+fi
+
+exit 0
+