From 1403a5fef3815f37d7f5debcb783358a2c445619 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:54:25 +0000 Subject: [PATCH 1/3] feat: Updated scripts/githooks/pre-commit.sh --- scripts/githooks/pre-commit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/githooks/pre-commit.sh b/scripts/githooks/pre-commit.sh index 60328249..b11216d7 100644 --- a/scripts/githooks/pre-commit.sh +++ b/scripts/githooks/pre-commit.sh @@ -63,7 +63,7 @@ printMessage "Running local openim pre-commit hook." # TODO! GIT_FILE_SIZE_LIMIT=50000000 git commit -m "test: this commit is allowed file sizes up to 50MB" # Maximum file size limit in bytes limit=${GIT_FILE_SIZE_LIMIT:-2000000} # Default 2MB -limitInMB=$(( $limit / 1000000 )) +limitInMB=$(( $limit / 1000000 )) # This will correctly calculate the file size limit in megabytes function file_too_large(){ filename=$file From 3b6d187ab8edd2cc47c9cca503089e5cac6c5a2c 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:56:25 +0000 Subject: [PATCH 2/3] feat: Updated scripts/githooks/pre-commit.sh --- scripts/githooks/pre-commit.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/githooks/pre-commit.sh b/scripts/githooks/pre-commit.sh index b11216d7..4f3e289c 100644 --- a/scripts/githooks/pre-commit.sh +++ b/scripts/githooks/pre-commit.sh @@ -75,9 +75,9 @@ file_too_large $filesize $filename # Moved the function call outside the HEREDOC file_too_large $filesize $filename - File $filename is $filesize MB, which is larger than github's maximum - file size (20 MB). We will not be able to push this file to GitHub. - The maximum file size allowed is 2MB. + File $filename is $filesize MB, which is larger than the maximum file size allowed ($limitInMB MB). + We will not be able to push this file to GitHub. + The maximum file size allowed is $limitInMB MB. Commit aborted HEREDOC From 4572b96ec641c7f94e9c9ae843518abda1d6bd93 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 16 Jan 2024 05:03:30 +0000 Subject: [PATCH 3/3] feat: Updated scripts/githooks/pre-commit.sh --- scripts/githooks/pre-commit.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/githooks/pre-commit.sh b/scripts/githooks/pre-commit.sh index 4f3e289c..a71bedde 100644 --- a/scripts/githooks/pre-commit.sh +++ b/scripts/githooks/pre-commit.sh @@ -33,7 +33,6 @@ chmod +x scripts/githooks/pre-commit.sh # LC_ALL=C - local_branch="$(git rev-parse --abbrev-ref HEAD)" valid_branch_regex="^(main|master|develop|release(-[a-zA-Z0-9._-]+)?)$|(feature|feat|openim|hotfix|test|bug|bot|refactor|revert|ci|cicd|style|)\/[a-z0-9._-]+$|^HEAD$"