diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/checkout.c | 2 | ||||
| -rw-r--r-- | src/diff_file.c | 2 | ||||
| -rw-r--r-- | src/submodule.c | 17 |
3 files changed, 15 insertions, 6 deletions
diff --git a/src/checkout.c b/src/checkout.c index dab83c65a..d95244a69 100644 --- a/src/checkout.c +++ b/src/checkout.c @@ -180,7 +180,7 @@ static bool checkout_is_workdir_modified( return true; } - if (git_submodule_status(&sm_status, sm) < 0 || + if (git_submodule_status(&sm_status, data->repo, wditem->path) < 0 || GIT_SUBMODULE_STATUS_IS_WD_DIRTY(sm_status)) rval = true; else if ((sm_oid = git_submodule_wd_id(sm)) == NULL) diff --git a/src/diff_file.c b/src/diff_file.c index cef4bc169..4d9ecc8d8 100644 --- a/src/diff_file.c +++ b/src/diff_file.c @@ -186,7 +186,7 @@ static int diff_file_content_commit_to_str( return error; } - if ((error = git_submodule_status(&sm_status, sm)) < 0) { + if ((error = git_submodule_status(&sm_status, fc->repo, fc->file->path)) < 0) { git_submodule_free(sm); return error; } diff --git a/src/submodule.c b/src/submodule.c index 78bf5198c..2faaa734d 100644 --- a/src/submodule.c +++ b/src/submodule.c @@ -1067,7 +1067,7 @@ int git_submodule_update(git_submodule *sm, int init, git_submodule_update_optio memcpy(&clone_options.fetch_opts, &update_options.fetch_opts, sizeof(git_fetch_options)); /* Get the status of the submodule to determine if it is already initialized */ - if ((error = git_submodule_status(&submodule_status, sm)) < 0) + if ((error = git_submodule_status(&submodule_status, sm->repo, sm->name)) < 0) goto done; /* @@ -1511,11 +1511,20 @@ int git_submodule__status( return 0; } -int git_submodule_status(unsigned int *status, git_submodule *sm) +int git_submodule_status(unsigned int *status, git_repository *repo, const char *name) { - assert(status && sm); + git_submodule *sm; + int error; + + assert(status && repo && name); + + if ((error = git_submodule_lookup(&sm, repo, name)) < 0) + return error; + + error = git_submodule__status(status, NULL, NULL, NULL, sm, 0); + git_submodule_free(sm); - return git_submodule__status(status, NULL, NULL, NULL, sm, 0); + return error; } int git_submodule_location(unsigned int *location, git_submodule *sm) |
