X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=check-gitattributes.sh;h=e461a7cfb8b25e98e46323fb3347904b68be5aa3;hp=d3c540fc6b636b42227e7d03a7f946b0e231c7f5;hb=df296c641ed4f3f46ed7828a4d83a51f18a946e6;hpb=991fbce1912d07f6cc636d423fbc6ddc5560dd1c diff --git a/check-gitattributes.sh b/check-gitattributes.sh index d3c540fc..e461a7cf 100755 --- a/check-gitattributes.sh +++ b/check-gitattributes.sh @@ -3,13 +3,13 @@ exec 3<&0 ISANYTHING=" -crlf" -ISBINARY=" -crlf -diff" +ISBINARY=" -diff -crlf" ISTEXT=" crlf=input" LF=" " eol=`cat .gitattributes` -find . -type f | { +find . -name .git -prune -o \( -type f -print \) | { unseen=`echo "$eol" | cut -d ' ' -f 1 | grep .` neweol= while IFS= read -r LINE; do @@ -33,16 +33,16 @@ find . -type f | { esac unseen=`{ echo "$nam"; echo "$nam"; echo "$unseen"; } | sort | uniq -u` case "$LF$eol$LF$neweol$LF" in - *$LF$nam$ISANYTHING$LF*) + *$LF$nam$ISANYTHING*$LF*) # ignore and treat as binary ;; - *$LF$nam$ISBINARY$LF*) + *$LF$nam$ISBINARY*$LF*) # should be binary if $t; then echo "WARNING: file $LINE is text, should be binary" fi ;; - *$LF$nam$ISTEXT$LF*) + *$LF$nam$ISTEXT*$LF*) # should be text if ! $t; then echo "WARNING: file $LINE is binary, should be text"