pre-push hook: Exclude merges from signoff check

Signed-off-by: Álvaro Brey Vilas <alvaro.brey@nextcloud.com>
This commit is contained in:
Álvaro Brey Vilas 2021-10-13 09:55:07 +02:00
parent 6b855fb2f9
commit 267c4c2b72
No known key found for this signature in database
GPG Key ID: 2585783189A62105

View File

@ -15,7 +15,7 @@ while read local_ref local_sha remote_ref remote_sha; do
fi
# Check for commits without sign-off
commit=$(git rev-list --grep 'Signed-off-by' --invert-grep "$range")
commit=$(git rev-list --no-merges --grep 'Signed-off-by' --invert-grep "$range")
if [ -n "$commit" ]; then
echo >&2 "Found commits without sign-off in $local_ref. Aborting push. Offending commits:"
echo >&2 "$commit"