Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make "yadm clone --recursive" work as expected. #517

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion yadm
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ function clone() {
DO_BOOTSTRAP=1
local -a args
local -i do_checkout=1
local -i do_submodules=0
while [[ $# -gt 0 ]]; do
case "$1" in
--bootstrap) # force bootstrap, without prompt
Expand All @@ -768,7 +769,10 @@ function clone() {
-n | --no-checkout)
do_checkout=0
;;
--bare | --mirror | --recurse-submodules* | --recursive | --separate-git-dir=*)
--recursive)
do_submodules=1
;;
--bare | --mirror | --recurse-submodules* | --separate-git-dir=*)
# ignore arguments without separate parameter
;;
--separate-git-dir)
Expand Down Expand Up @@ -835,6 +839,10 @@ function clone() {
"$GIT_PROGRAM" checkout -- ":/$file"
done

if [[ $do_submodules -ne 0 ]]; then
"$GIT_PROGRAM" submodule update --init --recursive
fi

if [ -n "$("$GIT_PROGRAM" ls-files --modified)" ]; then
local msg
IFS='' read -r -d '' msg <<EOF
Expand Down