]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
scripts: Change to the top source directory as needed
authorteor <teor@torproject.org>
Mon, 28 Oct 2019 03:28:50 +0000 (13:28 +1000)
committerteor <teor@torproject.org>
Mon, 28 Oct 2019 03:28:50 +0000 (13:28 +1000)
Bugfix on 31919; not in any released version of tor.

scripts/coccinelle/check_cocci_parse.sh
scripts/git/pre-push.git-hook

index 5c27c7bc885826ebba736dc7756bd2783cd9c70e..220b405940e64f19aeea001022626feeab4faf4c 100755 (executable)
@@ -30,6 +30,7 @@ if test $# -ge 1 ; then
   "$try_parse" "$@"
   exitcode=$?
 else
+  cd "$top" || exit 1
   # This is the layout in 0.3.5
   "$try_parse" \
     src/lib/*/*.[ch] \
index 2f3608029a155adec517d9ebb1b6a919cc119c45..7be184ec6e1d968ceb8ecea2d42d0fa41bba4667 100755 (executable)
@@ -28,6 +28,8 @@ upstream_name=${TOR_UPSTREAM_REMOTE_NAME:-"upstream"}
 
 workdir=$(git rev-parse --show-toplevel)
 
+cd "$workdir" || exit 1
+
 remote="$1"
 remote_name=$(git remote --verbose | grep "$2" | awk '{print $1}' | head -n 1)
 
@@ -83,7 +85,7 @@ do
 
         # We want word splitting here, because file names are space separated
         # shellcheck disable=SC2086
-        if ! "$workdir/"scripts/git/pre-commit.git-hook $CHECK_FILES; then
+        if ! scripts/git/pre-commit.git-hook $CHECK_FILES ; then
             exit 1
         fi