[__git]: Change default behaviour for --mode parameter

By default it only applies to the top-level directory, that way any permissions
that are specified in git are respected after cloning.

Old behaviour can be obtained with the new `--mode-recursive` parameter.

Closes #818.
This commit is contained in:
evilham 2020-06-17 22:28:07 +02:00
parent 79c3734913
commit 14f0780775
3 changed files with 13 additions and 1 deletions

View file

@ -52,8 +52,11 @@ case $state_should in
{ [ -n "$group" ] && [ "$group_is" != "$group" ]; }; then
echo chown -R "${owner}:${group}" "$destination"
fi
if [ -f "$__object/parameter/mode-recursive" ]; then
mode_recursive="-R"
fi
if [ -n "$mode" ]; then
echo chmod -R "$mode" "$destination"
echo chmod "${mode_recursive}" "$mode" "$destination"
fi
;;

View file

@ -31,10 +31,18 @@ group
mode
Unix permissions, suitable for chmod.
By default it only applies to the top-level directory.
See the mode-recursive parameter as well.
owner
User to chown to.
BOOLEAN PARAMETERS
------------------
mode-recursive
If present and --mode is passed, the given permissions will be applied
recursively to the working directory.
recursive
Passes the --recurse-submodules flag to git when cloning the repository.

View file

@ -1,2 +1,3 @@
mode-recursive
recursive
shallow