From 5d3cd4e309517a8ab2b553ad0839493ba45bb97d Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Tue, 31 Jan 2012 13:09:39 -0800 Subject: [PATCH] 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. --- src/status.c | 14 ++++++++++++-- 1 file 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)