mirror of
https://github.com/thomiceli/opengist.git
synced 2024-12-23 04:52:40 +00:00
25 lines
433 B
Bash
25 lines
433 B
Bash
#!/bin/sh
|
|
|
|
disallowed_files=""
|
|
|
|
while read -r old_rev new_rev ref
|
|
do
|
|
while IFS= read -r file
|
|
do
|
|
case $file in
|
|
*/*)
|
|
disallowed_files="${disallowed_files}${file} "
|
|
;;
|
|
esac
|
|
done <<EOF
|
|
$(git diff --name-only "$old_rev" "$new_rev")
|
|
EOF
|
|
done
|
|
|
|
if [ -n "$disallowed_files" ]; then
|
|
echo "Pushing files in folders is not allowed:"
|
|
for file in $disallowed_files; do
|
|
echo " $file"
|
|
done
|
|
exit 1
|
|
fi
|