Merge branch 'sb/checkout-recurse-submodules'
authorJunio C Hamano <gitster@pobox.com>
Mon, 29 May 2017 03:34:41 +0000 (12:34 +0900)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 May 2017 03:34:41 +0000 (12:34 +0900)
"git checkout --recurse-submodules" did not quite work with a
submodule that itself has submodules.

* sb/checkout-recurse-submodules:
submodule: properly recurse for read-tree and checkout
submodule: avoid auto-discovery in new working tree manipulator code
submodule_move_head: reuse child_process structure for futher commands

1  2 
submodule.c
t/lib-submodule-update.sh
diff --cc submodule.c
index 54825100b29bd6bb9614bd2ab2431c6d418945b0,b3ae642f29205655342b08343d440d7f333a39f9..268f25fc2c471d6e84c73403456aaf496c132bf1
@@@ -1445,16 -1436,9 +1445,16 @@@ int submodule_move_head(const char *pat
                        /* make sure the index is clean as well */
                        submodule_reset_index(path);
                }
 +
 +              if (old && (flags & SUBMODULE_MOVE_HEAD_FORCE)) {
 +                      char *gitdir = xstrfmt("%s/modules/%s",
 +                                  get_git_common_dir(), sub->name);
 +                      connect_work_tree_and_git_dir(path, gitdir);
 +                      free(gitdir);
 +              }
        }
  
-       prepare_submodule_repo_env_no_git_dir(&cp.env_array);
+       prepare_submodule_repo_env(&cp.env_array);
  
        cp.git_cmd = 1;
        cp.no_stdin = 1;
Simple merge