diff options
Diffstat (limited to 'run')
| -rwxr-xr-x | run | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -2,9 +2,16 @@ set REPO_PERMISSIONS /etc/repo-permissions set GIT_COMMAND_REGEX "^(git-(?:upload-pack|receive-pack|upload-archive)) '((?:\/[a-zA-Z-]+)+.git)'\$" + +# check given git command +set -l matcher (string match -r -g $GIT_COMMAND_REGEX "$argv") +if test (count $matcher) -ne 2 + # there should be two groups otherwise something is wrong + exit 1 +end + # echo check for permissions set -l checkUser (whoami) -set -l matcher (string match -r -g $GIT_COMMAND_REGEX "$argv") set -l gitCommand $matcher[1] set -l repo $matcher[2] set -l repoDir srv repos |
