From e77d5012bed9dd58fd7a409d6d47839177b33ff1 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 4 Dec 2013 16:45:54 -0800 Subject: [PATCH] Fix two issues with shell/config scripts for hosted repositories Summary: Ref T4151. `-ne` is numeric in some/most/all shells; `exec --` apparently doens't always work. Test Plan: Will make @zeeg test. Reviewers: btrahan, zeeg Reviewed By: zeeg CC: zeeg, aran Maniphest Tasks: T4151 Differential Revision: https://secure.phabricator.com/D7702 --- resources/sshd/phabricator-ssh-hook.sh | 2 +- .../repository/engine/PhabricatorRepositoryPullEngine.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/sshd/phabricator-ssh-hook.sh b/resources/sshd/phabricator-ssh-hook.sh index 30f5e77b81..fc7de81dad 100755 --- a/resources/sshd/phabricator-ssh-hook.sh +++ b/resources/sshd/phabricator-ssh-hook.sh @@ -6,7 +6,7 @@ VCSUSER="vcs-user" # NOTE: Replace this with the path to your Phabricator directory. ROOT="/path/to/phabricator" -if [ "$1" -ne "$VCSUSER" ]; +if [ "$1" != "$VCSUSER" ]; then exit 1 fi diff --git a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php index 2198eb46ea..5e73c0e6db 100644 --- a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php +++ b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php @@ -162,7 +162,7 @@ final class PhabricatorRepositoryPullEngine $root = dirname(phutil_get_library_root('phabricator')); $bin = $root.'/bin/commit-hook'; - $cmd = csprintf('exec -- %s %s "$@"', $bin, $callsign); + $cmd = csprintf('exec %s %s "$@"', $bin, $callsign); $hook = "#!/bin/sh\n{$cmd}\n";