From 23ec9f6fa940bb829699395ed22d6d540064fa37 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Mon, 7 Apr 2025 19:27:56 +0200 Subject: [PATCH] refactor(hooks): simplify new branch validation logic --- hooks/pre-recieve.sh | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/hooks/pre-recieve.sh b/hooks/pre-recieve.sh index c8a0fa0..5bb61be 100644 --- a/hooks/pre-recieve.sh +++ b/hooks/pre-recieve.sh @@ -43,16 +43,7 @@ while read -r OLD_REV NEW_REV REF_NAME; do # Handle new branch pushes differently if [[ "$OLD_REV" = "0000000000000000000000000000000000000000" ]]; then - echo -e "${YELLOW}New branch detected: $REF_NAME${NC}" - - # For new branches, only validate the last 10 commits by default - COMMIT_COUNT=$(git rev-list --count "$NEW_REV") - if [ "$COMMIT_COUNT" -gt 10 ]; then - OLD_REV=$(git rev-list -n 1 "$NEW_REV"~10) - echo -e "${BLUE}New branch - validating only the latest 10 commits${NC}" - else - echo -e "${BLUE}New branch - validating all $COMMIT_COUNT commits${NC}" - fi + continue fi echo -e "${YELLOW}Checking commits in $REF_NAME${NC}"