]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix pre-commit hook to correctly allow empty changes files.
authorNick Mathewson <nickm@torproject.org>
Wed, 10 Apr 2019 15:49:23 +0000 (11:49 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 10 Apr 2019 15:49:23 +0000 (11:49 -0400)
Fixes bug 30120; bugfix not in any released Tor.

scripts/git/pre-commit.git-hook

index 65fa99f4c4e55411049973601b36b8f09720272c..4a962851b05a3856761d7976d74a754723dd5e9b 100755 (executable)
@@ -12,7 +12,7 @@ cd "$workdir" || exit 1
 
 set -e
 
-if [ ! -z "ls ./changes/*" ]; then
+if [ -n "$(ls ./changes/)" ]; then
     python scripts/maint/lintChanges.py ./changes/*
 fi
 
@@ -26,7 +26,7 @@ if [ -d src/lib ]; then
          src/test/*.[ch] \
          src/test/*/*.[ch] \
          src/tools/*.[ch]
-elif [ -d src/common]; then
+elif [ -d src/common ]; then
     # This was the layout before 0.3.5
     perl scripts/maint/checkSpace.pl -C \
          src/common/*/*.[ch] \