examples: adjust to submodule status API change
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
diff --git a/examples/status.c b/examples/status.c
index 62cb5b2..8e242dd 100644
--- a/examples/status.c
+++ b/examples/status.c
@@ -384,25 +384,19 @@ static void print_short(git_repository *repo, git_status_list *status)
if (s->index_to_workdir &&
s->index_to_workdir->new_file.mode == GIT_FILEMODE_COMMIT)
{
- git_submodule *sm = NULL;
unsigned int smstatus = 0;
- if (!git_submodule_lookup(
- &sm, repo, s->index_to_workdir->new_file.path)) {
-
- if (!git_submodule_status(&smstatus, sm)) {
- if (smstatus & GIT_SUBMODULE_STATUS_WD_MODIFIED)
- extra = " (new commits)";
- else if (smstatus & GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED)
- extra = " (modified content)";
- else if (smstatus & GIT_SUBMODULE_STATUS_WD_WD_MODIFIED)
- extra = " (modified content)";
- else if (smstatus & GIT_SUBMODULE_STATUS_WD_UNTRACKED)
- extra = " (untracked content)";
- }
+ if (!git_submodule_status(&smstatus, repo, s->index_to_workdir->new_file.path,
+ GIT_SUBMODULE_IGNORE_FALLBACK)) {
+ if (smstatus & GIT_SUBMODULE_STATUS_WD_MODIFIED)
+ extra = " (new commits)";
+ else if (smstatus & GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED)
+ extra = " (modified content)";
+ else if (smstatus & GIT_SUBMODULE_STATUS_WD_WD_MODIFIED)
+ extra = " (modified content)";
+ else if (smstatus & GIT_SUBMODULE_STATUS_WD_UNTRACKED)
+ extra = " (untracked content)";
}
-
- git_submodule_free(sm);
}
/**