mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-08 01:09:46 +00:00
examples: adjust to submodule status API change
This commit is contained in:
parent
4536574acc
commit
7d6dacdc17
@ -384,25 +384,19 @@ 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 (smstatus & GIT_SUBMODULE_STATUS_WD_MODIFIED)
|
||||||
if (!git_submodule_status(&smstatus, sm)) {
|
extra = " (new commits)";
|
||||||
if (smstatus & GIT_SUBMODULE_STATUS_WD_MODIFIED)
|
else if (smstatus & GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED)
|
||||||
extra = " (new commits)";
|
extra = " (modified content)";
|
||||||
else if (smstatus & GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED)
|
else if (smstatus & GIT_SUBMODULE_STATUS_WD_WD_MODIFIED)
|
||||||
extra = " (modified content)";
|
extra = " (modified content)";
|
||||||
else if (smstatus & GIT_SUBMODULE_STATUS_WD_WD_MODIFIED)
|
else if (smstatus & GIT_SUBMODULE_STATUS_WD_UNTRACKED)
|
||||||
extra = " (modified content)";
|
extra = " (untracked content)";
|
||||||
else if (smstatus & GIT_SUBMODULE_STATUS_WD_UNTRACKED)
|
|
||||||
extra = " (untracked content)";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
git_submodule_free(sm);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user