diff options
author | teor <teor@torproject.org> | 2019-10-28 13:28:50 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-10-28 13:28:50 +1000 |
commit | 3479024cb1034dd453fed577b493cbe5515765d3 (patch) | |
tree | b9735780e7043fc19e9f5b6ea066f0cb03688c04 /scripts/git/pre-push.git-hook | |
parent | 18e09913bf23253645404612726983c5c43e19cc (diff) | |
download | tor-3479024cb1034dd453fed577b493cbe5515765d3.tar.gz tor-3479024cb1034dd453fed577b493cbe5515765d3.zip |
scripts: Change to the top source directory as needed
Bugfix on 31919; not in any released version of tor.
Diffstat (limited to 'scripts/git/pre-push.git-hook')
-rwxr-xr-x | scripts/git/pre-push.git-hook | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/git/pre-push.git-hook b/scripts/git/pre-push.git-hook index 2f3608029a..7be184ec6e 100755 --- a/scripts/git/pre-push.git-hook +++ b/scripts/git/pre-push.git-hook @@ -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 |