summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRussell Belfer <arrbee@arrbee.com>2012-01-31 13:09:39 -0800
committerRussell Belfer <arrbee@arrbee.com>2012-01-31 13:09:39 -0800
commit5d3cd4e309517a8ab2b553ad0839493ba45bb97d (patch)
treeef1771f0328f262b8bb564d0d907d3451a626e0b /src
parent279afd2a514160754eeba8e5db84600486f70761 (diff)
downloadlibgit2-5d3cd4e309517a8ab2b553ad0839493ba45bb97d.tar.gz
Convert status assert to skip file
When status encounters a submodule, right now it is asserting. This changes it to just skip the file that it can't deal with.
Diffstat (limited to 'src')
-rw-r--r--src/status.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/status.c b/src/status.c
index 492edf568..ae833ea97 100644
--- a/src/status.c
+++ b/src/status.c
@@ -321,8 +321,18 @@ static int determine_status(
}
/* Last option, we're dealing with a leftover folder tree entry */
- assert(in_head && !in_index && !in_workdir && (tree_entry_type == GIT_OBJ_TREE));
- return process_folder(st, tree_entry, full_path, path_type);
+ 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;
+ }
}
static int path_type_from(git_buf *full_path, int is_dir)