mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
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:
@@ -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...)
|
||||
|
||||
Reference in New Issue
Block a user