From ea95a97b8348af0c9320e832205b9b2ea917ddfd Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 16 Jan 2024 04:32:07 +0000 Subject: [PATCH 1/2] feat: Updated scripts/githooks/pre-commit.sh --- scripts/githooks/pre-commit.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/githooks/pre-commit.sh b/scripts/githooks/pre-commit.sh index a88ca74f..58561c54 100644 --- a/scripts/githooks/pre-commit.sh +++ b/scripts/githooks/pre-commit.sh @@ -66,11 +66,13 @@ limit=${GIT_FILE_SIZE_LIMIT:-2000000} # Default 2MB limitInMB=$(( $limit / 1000000 )) function file_too_large(){ - filename=$0 + filename=$file filesize=$(( $1 / 2**20 )) filesize=$(( $1 \/ 2**20 ))\ncat < Date: Tue, 16 Jan 2024 04:32:29 +0000 Subject: [PATCH 2/2] feat: Updated scripts/githooks/pre-commit.sh --- scripts/githooks/pre-commit.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/githooks/pre-commit.sh b/scripts/githooks/pre-commit.sh index 58561c54..24a5109c 100644 --- a/scripts/githooks/pre-commit.sh +++ b/scripts/githooks/pre-commit.sh @@ -107,7 +107,8 @@ if $shouldFail then printMessage "If you really need to commit this file, you can override the size limit by setting the GIT_FILE_SIZE_LIMIT environment variable, e.g. GIT_FILE_SIZE_LIMIT=20000000 for 20MB. Or, commit with the --no-verify switch to skip the check entirely." printError "Commit aborted" - exit 1; + echo "For more information, refer to: https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694" + exit 1; fi if [[ ! $local_branch =~ $valid_branch_regex ]]