Skip to content

Commit a12ea6a

Browse files
author
allan
committed
chore: removing commit size check
1 parent a6b52b5 commit a12ea6a

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

.git-hooks/pre-commit

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,4 @@ if [[ "$BRANCH" =~ ^(master|main|develop)$ ]]; then
1515
echo "You are on branch $BRANCH. Are you sure you want to commit to this branch?"
1616
echo "If so, commit with -n to bypass the pre-commit hook."
1717
exit 1
18-
fi
19-
20-
## Avoid large commits
21-
# https://www.backblaze.com/blog/how-many-bytes-are-in-a-megabyte-really/
22-
size_limit=$((2 * 2**20)) # 2mbs
23-
# https://git-scm.com/docs/git-rev-list#Documentation/git-rev-list.txt---disk-usage
24-
commit_size=$(git rev-list --disk-usage HEAD^..HEAD)
25-
test "$commit_size" -lt "$size_limit" || (
26-
echo "Commit size is too large: $commit_size > $size_limit"
27-
echo "Force commit using --no-verify"
28-
exit 1
29-
)
18+
fi

0 commit comments

Comments
 (0)