diff --git a/internal/resources/pre-receive b/internal/resources/pre-receive index 86121c3..693b7a0 100644 --- a/internal/resources/pre-receive +++ b/internal/resources/pre-receive @@ -1,20 +1,24 @@ #!/bin/sh -disallowed_files=() +disallowed_files="" -while read old_rev new_rev ref +while read -r old_rev new_rev ref do - for file in $(git diff --name-only $old_rev $new_rev) + while IFS= read -r file do - if [[ $file =~ / ]]; then - disallowed_files+=($file) - fi - done + case $file in + */*) + disallowed_files="${disallowed_files}${file} " + ;; + esac + done <