diff --git a/cdist/conf/type/__git/gencode-remote b/cdist/conf/type/__git/gencode-remote index a36ff5cd..ab22655f 100755 --- a/cdist/conf/type/__git/gencode-remote +++ b/cdist/conf/type/__git/gencode-remote @@ -36,6 +36,7 @@ group=$(cat "$__object/parameter/group") mode=$(cat "$__object/parameter/mode") [ -f "$__object/parameter/recursive" ] && recursive='--recurse-submodules' || recursive='' +[ -f "$__object/parameter/shallow" ] && shallow='--depth 1 --shallow-submodules' || shallow='' [ "$state_should" = "$state_is" ] \ && [ "$owner" = "$owner_is" ] \ @@ -45,7 +46,7 @@ mode=$(cat "$__object/parameter/mode") case $state_should in present) if [ "$state_should" != "$state_is" ]; then - echo git clone --quiet "$recursive" --branch "$branch" "$source" "$destination" + echo git clone --quiet "$recursive" "$shallow" --branch "$branch" "$source" "$destination" fi if { [ -n "$owner" ] && [ "$owner_is" != "$owner" ]; } || \ { [ -n "$group" ] && [ "$group_is" != "$group" ]; }; then diff --git a/cdist/conf/type/__git/man.rst b/cdist/conf/type/__git/man.rst index f18a5a0e..d3e15f25 100644 --- a/cdist/conf/type/__git/man.rst +++ b/cdist/conf/type/__git/man.rst @@ -38,6 +38,10 @@ owner recursive Passes the --recurse-submodules flag to git when cloning the repository. +shallow + Sets --depth=1 and --shallow-submodules for cloning repositories with big history. + + EXAMPLES -------- diff --git a/cdist/conf/type/__git/parameter/boolean b/cdist/conf/type/__git/parameter/boolean index a633e659..d600d4ca 100644 --- a/cdist/conf/type/__git/parameter/boolean +++ b/cdist/conf/type/__git/parameter/boolean @@ -1 +1,2 @@ recursive +shallow