From 6c86bf73a8ed0f89b13ff2e76934f3eee2230601 Mon Sep 17 00:00:00 2001 From: Bert Wesarg <bert.wesarg@tu-dresden.de> Date: Tue, 5 Nov 2024 13:01:32 +0100 Subject: [PATCH] check: Use Git attributes to determine if a file is a Git LFS file --- doc.zih.tu-dresden.de/util/check-filesize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc.zih.tu-dresden.de/util/check-filesize.sh b/doc.zih.tu-dresden.de/util/check-filesize.sh index 35fed9a7e..d1b9d4e64 100755 --- a/doc.zih.tu-dresden.de/util/check-filesize.sh +++ b/doc.zih.tu-dresden.de/util/check-filesize.sh @@ -34,11 +34,11 @@ large_files_present=false branch="origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-preview}" source_hash=`git merge-base HEAD "${branch}"` -lfsfiles=$(git lfs ls-files -n) for f in $(git diff --name-only --diff-filter=d ${source_hash}); do # Do not check size of git lfs files. - if [[ ${lfsfiles} =~ "${f}" ]]; then + filter_attribute=$(git check-attr filter -- "${f}") + if [[ "${filter_attribute#*: filter: }" = "lfs" ]]; then echo "Skip file ${f} because it is a git lfs file." continue fi -- GitLab