pre-commit: Avoid prefixing string comparissons with x

This was working around bugs in various shells, but this
problem has been fixed for a decade now.

https://www.shellcheck.net/wiki/SC2268

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6652>
This commit is contained in:
Jordan Petridis 2024-04-16 11:33:44 +03:00 committed by GStreamer Marge Bot
parent 490deafcbe
commit d72d79d85a

View file

@ -8,11 +8,11 @@
# so check for that first.
version=$(gnuindent --version 2>/dev/null)
if test "x$version" = "x"; then
if test -z "$version"; then
version=$(gindent --version 2>/dev/null)
if test "x$version" = "x"; then
if test -z "$version"; then
version=$(indent --version 2>/dev/null)
if test "x$version" = "x"; then
if test -z "$version"; then
echo "GStreamer git pre-commit hook:"
echo "Did not find GNU indent, please install it before continuing."
exit 1
@ -92,9 +92,9 @@ echo "==========================================================================
fi
csharp_files=$( git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "^subprojects/gstreamer-sharp/.*cs$" )
if test "x$csharp_files" != "x"; then
if test -n "$csharp_files"; then
version=$(dotnet-format --version 2>/dev/null)
if test "x$version" = "x"; then
if test -z "$version"; then
echo "GStreamer git pre-commit hook:"
echo "Did not find dotnet-format required to format C# files, please install it before continuing."
exit 1