Commit 7d6dacdc by Carlos Martín Nieto

examples: adjust to submodule status API change

parent 4536574a
...@@ -384,13 +384,10 @@ static void print_short(git_repository *repo, git_status_list *status) ...@@ -384,13 +384,10 @@ static void print_short(git_repository *repo, git_status_list *status)
if (s->index_to_workdir && if (s->index_to_workdir &&
s->index_to_workdir->new_file.mode == GIT_FILEMODE_COMMIT) s->index_to_workdir->new_file.mode == GIT_FILEMODE_COMMIT)
{ {
git_submodule *sm = NULL;
unsigned int smstatus = 0; unsigned int smstatus = 0;
if (!git_submodule_lookup( if (!git_submodule_status(&smstatus, repo, s->index_to_workdir->new_file.path,
&sm, repo, s->index_to_workdir->new_file.path)) { GIT_SUBMODULE_IGNORE_FALLBACK)) {
if (!git_submodule_status(&smstatus, sm)) {
if (smstatus & GIT_SUBMODULE_STATUS_WD_MODIFIED) if (smstatus & GIT_SUBMODULE_STATUS_WD_MODIFIED)
extra = " (new commits)"; extra = " (new commits)";
else if (smstatus & GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED) else if (smstatus & GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED)
...@@ -402,9 +399,6 @@ static void print_short(git_repository *repo, git_status_list *status) ...@@ -402,9 +399,6 @@ static void print_short(git_repository *repo, git_status_list *status)
} }
} }
git_submodule_free(sm);
}
/** /**
* Now that we have all the information, format the output. * Now that we have all the information, format the output.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment