diff options
| author | Vicent Marti <vicent@github.com> | 2014-03-26 18:29:34 +0100 |
|---|---|---|
| committer | Vicent Marti <vicent@github.com> | 2014-03-26 18:29:34 +0100 |
| commit | dc7efa1aef2d3694e7a1955d746d26013402a21d (patch) | |
| tree | 53fe478631e02e372508d981093c2abace29ce42 /examples/status.c | |
| parent | 77b699e0da3d4a4fed742893bd172f3ee7b936d5 (diff) | |
| parent | 591e82952a2835c3d411ee5abec78be3b0816861 (diff) | |
| download | libgit2-dc7efa1aef2d3694e7a1955d746d26013402a21d.tar.gz | |
Merge pull request #2204 from libgit2/rb/submodule-reference-counting
Make submodules externally refcounted
Diffstat (limited to 'examples/status.c')
| -rw-r--r-- | examples/status.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/examples/status.c b/examples/status.c index 3adfe0d5d..feba77f84 100644 --- a/examples/status.c +++ b/examples/status.c @@ -363,18 +363,21 @@ static void print_short(git_repository *repo, git_status_list *status) unsigned int smstatus = 0; if (!git_submodule_lookup( - &sm, repo, s->index_to_workdir->new_file.path) && - !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)"; + &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)"; + } } + + git_submodule_free(sm); } /** |
