Skip to content
Snippets Groups Projects
Verified Commit ff6d64b2 authored by Lars Bilke's avatar Lars Bilke
Browse files

Removed git lfs config.

Closes #2961.
parent f58c7bd8
No related branches found
No related tags found
No related merge requests found
......@@ -8,5 +8,3 @@
*.h hooks.style=uncrustify
*.cpp hooks.style=uncrustify
*.hpp hooks.style=uncrustify
# Git LFS
# Gocad files
[lfs]
url = https://ogs.jfrog.io/ogs/api/lfs/ogs
......@@ -22,11 +22,6 @@ repos:
language: system
files: '.*\.cpp'
stages: [commit, manual]
- id: git-lfs
name: Check git lfs files
entry: scripts/hooks/pre-commit-git-lfs.sh
language: system
stages: [commit, manual]
- id: cmake-format
name: Format CMake files
entry: scripts/hooks/pre-commit-cmake-format.sh
......
#!/usr/bin/env bash
BINARY_FILES=""
LFS_FILES=""
LFS_FILES=()
for FILE in "$@"
do
LFS_FILE=$(git check-attr filter "$FILE" | grep 'filter: lfs$' | sed -e 's/: filter: lfs//')
if [ ! -z "$LFS_FILE" ]; then
LFS_FILES+=("$LFS_FILE")
fi
done
if [ -z "$LFS_FILES" ]; then
exit 0
fi
for FILE in ${LFS_FILES[@]}
do
SOFT_SHA=$(git hash-object -w "$FILE")
RAW_SHA=$(git hash-object -w --no-filters "$FILE")
if [ $SOFT_SHA == $RAW_SHA ]; then
BINARY_FILES="$FILE\n$BINARY_FILES"
fi
done
if [[ -n "$BINARY_FILES" ]]; then
echo "Attention!"
echo "----------"
echo "You tried to commit binary files:"
echo -e "\x1B[31m$BINARY_FILES\x1B[0m"
echo "Make sure you have git-lfs installed properly!"
echo "Revert your changes and commit those files with git-lfs!"
echo "----------"
exit 1
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment