diff options
| author | Vicent Martà <tanoku@gmail.com> | 2012-02-01 17:41:54 +0100 |
|---|---|---|
| committer | Vicent Martà <tanoku@gmail.com> | 2012-02-01 17:42:26 +0100 |
| commit | 4ea79a9d6e8f52faf8598b96ed53c3066cba0f83 (patch) | |
| tree | 66afda47eb06cf7a2052f4571308401de42c6d1b /src/status.c | |
| parent | bf0107d1ece702d67e13f4e7e5063fbcabf6c040 (diff) | |
| download | libgit2-4ea79a9d6e8f52faf8598b96ed53c3066cba0f83.tar.gz | |
status: Document submodule TODOs
Diffstat (limited to 'src/status.c')
| -rw-r--r-- | src/status.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/status.c b/src/status.c index d10491c24..62ef35685 100644 --- a/src/status.c +++ b/src/status.c @@ -226,8 +226,12 @@ static int process_folder( /* No op */ break; + case GIT_OBJ_COMMIT: + /* TODO: proper submodule support */ + break; + default: - error = git__throw(GIT_EINVALIDTYPE, "Unexpected tree entry type"); /* TODO: How should we deal with submodules? */ + return git__throw(GIT_EINVALIDTYPE, "Unexpected tree entry type"); } } @@ -246,8 +250,9 @@ static int process_folder( git_ignore__free(st->ignores); st->ignores = old_ignores; } - } else + } else { error = dirent_cb(st, NULL); + } if (tree_entry_type == GIT_OBJ_TREE) { git_object_free(subtree); @@ -320,19 +325,19 @@ static int determine_status( return store_if_changed(st, e); } - /* Last option, we're dealing with a leftover folder tree entry */ + /* Are we dealing with a subtree? */ if (tree_entry_type == GIT_OBJ_TREE) { assert(in_head && !in_index && !in_workdir); return process_folder(st, tree_entry, full_path, path_type); } - else { - /* skip anything else we found (such as a submodule) */ - if (in_head) - st->tree_position++; - if (in_index) - st->index_position++; - return GIT_SUCCESS; - } + + /* We're dealing with something else -- most likely a submodule; + * skip it for now */ + if (in_head) + st->tree_position++; + if (in_index) + st->index_position++; + return GIT_SUCCESS; } static int path_type_from(git_buf *full_path, int is_dir) |
