From 21b5e15f55c3894806a89324c832ca0b7e8c0797 Mon Sep 17 00:00:00 2001 From: Starfall Date: Tue, 17 Jan 2023 16:47:04 -0600 Subject: pre-commit-hook: default pre commit hook to avoid commiting unmerged files --- pre-commit-hook | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 pre-commit-hook 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 + -- cgit