Skip to content

Commit 47d5d64

Browse files
stefanbellergitster
authored andcommitted
submodule--helper clone: create the submodule path just once
We make sure that the parent directory of path exists (or create it otherwise) and then do the same for path + "/.git". That is equivalent to just making sure that the parent directory of path + "/.git" exists (or create it otherwise). Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3c0663e commit 47d5d64

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

builtin/submodule--helper.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,7 @@ static int module_clone(int argc, const char **argv, const char *prefix)
215215
}
216216

217217
/* Write a .git file in the submodule to redirect to the superproject. */
218-
if (safe_create_leading_directories_const(path) < 0)
219-
die(_("could not create directory '%s'"), path);
220-
221218
strbuf_addf(&sb, "%s/.git", path);
222-
223219
if (safe_create_leading_directories_const(sb.buf) < 0)
224220
die(_("could not create leading directories of '%s'"), sb.buf);
225221
submodule_dot_git = fopen(sb.buf, "w");

0 commit comments

Comments
 (0)