Skip to content

Commit

Permalink
workaround issue with file command
Browse files Browse the repository at this point in the history
  • Loading branch information
sloriot committed Jan 17, 2025
1 parent 796a7bd commit 679cd8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Scripts/developer_scripts/test_merge_of_branch
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ fi

#check no file contains non-utf8 characters
echo '.. Checking if non utf-8 characters are used...'
txt_not_utf8=$(git ls-files -z --stage | awk -F"\t" 'BEGIN { RS="\0" }; { printf "%s\n", $2; }' | xargs file -N | grep "text" | grep -E -v "UTF-8|ASCII|CSV|XML|EPS|FIG|JSON|pixmap|assembler source|Perl script|from flex")
txt_not_utf8=$(git ls-files -z --stage | awk -F"\t" 'BEGIN { RS="\0" }; { printf "%s\n", $2; }' | xargs file -N | grep "text" | grep -E -v "UTF-8|ASCII|CSV|XML|EPS|FIG|JSON|pixmap|magic|assembler source|Perl script|from flex")
if [ -n "${txt_not_utf8}" ]; then
echo "The following files have non utf-8 characters:"
echo ${txt_not_utf8}
Expand Down

1 comment on commit 679cd8c

@albert-github
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also did some investigations and I got the impression that the problem comes from the Linux file command, in the 5.46 (and 5.45) version I see the text "magic text fragment" whilst I don't see this in the file 5.44 version.

Interesting repository here is: https://github.com/file/file/ and the home page: https://www.darwinsys.com/file/

Please sign in to comment.