submodule: Do not try to update a missing submodule

If a submodule has been configured but not yet added, do not try to update it.

Issue #6433: git_submodule_update fails to update configured but missing submodule
This commit is contained in:
tagesuhu
2022-11-25 16:38:58 +00:00
committed by GitHub
parent b57b7628d4
commit 3f4b91b29d

View File

@@ -1338,7 +1338,11 @@ int git_submodule_update(git_submodule *sm, int init, git_submodule_update_optio
/* Get the status of the submodule to determine if it is already initialized */
if ((error = git_submodule_status(&submodule_status, sm->repo, sm->name, GIT_SUBMODULE_IGNORE_UNSPECIFIED)) < 0)
goto done;
/* If the submodule is configured but hasn't been added, skip it */
if (submodule_status == GIT_SUBMODULE_STATUS_IN_CONFIG)
goto done;
/*
* If submodule work dir is not already initialized, check to see
* what we need to do (initialize, clone, return error...)