summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-05-09 10:42:00 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-06-22 17:02:55 +0200
commit7d6dacdc17303305748fed226af35d8a4e5abc77 (patch)
tree6d1092909f5bd8b39b951e0eca7431b748f71868 /examples
parent4536574acc85d8c78ceeac872eed6e4f79ef9aaa (diff)
downloadlibgit2-7d6dacdc17303305748fed226af35d8a4e5abc77.tar.gz
examples: adjust to submodule status API change
Diffstat (limited to 'examples')
-rw-r--r--examples/status.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/examples/status.c b/examples/status.c
index 62cb5b24f..8e242dd39 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);
}
/**