From 2c57617fdb56c57377115b51d57d7b2202dba9ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Skrzy=C5=84ski?= Date: Tue, 22 Mar 2022 13:49:37 +0100 Subject: [PATCH] #1672: improve post-commit hooks --- scripts/post-commit | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/post-commit b/scripts/post-commit index ea8e3dd43e..8c1a0aa4a3 100755 --- a/scripts/post-commit +++ b/scripts/post-commit @@ -5,6 +5,12 @@ # every commit. # Prints the resulting changes if there are any. +# don't run the action during rebase +if ! [[ $(git branch --show-current) ]] +then + exit +fi + output=$(git clang-format HEAD~1) if [ "$output" != "" ]