Skip to content
Snippets Groups Projects

ignore-file-size-gitlfs

Merged Martin Schroschk requested to merge ignore-file-size-gitlfs into preview
1 unresolved thread
Files
2
@@ -34,12 +34,18 @@
@@ -34,12 +34,18 @@
large_files_present=false
large_files_present=false
branch="origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-preview}"
branch="origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-preview}"
source_hash=`git merge-base HEAD "$branch"`
source_hash=`git merge-base HEAD "$branch"`
 
lfsfiles=$(git lfs ls-files -n)
for f in $(git diff $source_hash --name-only); do
for f in $(git diff $source_hash --name-only); do
 
# Do not check size of git lfs files.
 
if [[ $lfsfiles =~ "$f" ]]; then
 
echo "Skip file ${f} because it is a git lfs file."
 
continue
 
fi
fs=$(wc -c $f | awk '{print $1}')
fs=$(wc -c $f | awk '{print $1}')
if [ $fs -gt 1048576 ]; then
if [ $fs -gt 1048576 ]; then
echo $f 'is over 1M ('$fs' bytes)'
echo $f 'is over 1M ('$fs' bytes)'
large_files_present=true
large_files_present=true
fi
fi
done
done
Loading