From 8cf077f4d52e53f9b09e72bae2a358aa282d89f9 Mon Sep 17 00:00:00 2001 From: Luc Bertrand Date: Wed, 3 Aug 2011 13:37:24 +0200 Subject: [PATCH 1/3] fix recurse_tree_entries, continue parsing tree after first subdirectory found --- src/status.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/status.c b/src/status.c index 3e46ea873..8be46eb01 100644 --- a/src/status.c +++ b/src/status.c @@ -91,7 +91,7 @@ static void recurse_tree_entries(git_tree *tree, git_vector *entries, char *path if (git_tree_lookup(&subtree, tree->object.repo, &tree_entry->oid) == GIT_SUCCESS) { recurse_tree_entries(subtree, entries, file_path); git_tree_close(subtree); - return; + continue; } if ((idx = find_status_entry(entries, file_path)) != GIT_ENOTFOUND) From 9d9e492dc0e61468d1914a449f080a75ee171b4b Mon Sep 17 00:00:00 2001 From: Luc Bertrand Date: Wed, 3 Aug 2011 13:38:02 +0200 Subject: [PATCH 2/3] remove unused variable --- src/status.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/status.c b/src/status.c index 8be46eb01..50810a057 100644 --- a/src/status.c +++ b/src/status.c @@ -247,7 +247,6 @@ int git_status_foreach(git_repository *repo, int (*callback)(const char *, unsig unsigned int i, cnt; git_index_entry *index_entry; char temp_path[GIT_PATH_MAX]; - git_oid zero; int error; git_tree *tree; struct status_st dirent_st; @@ -284,7 +283,6 @@ int git_status_foreach(git_repository *repo, int (*callback)(const char *, unsig strcpy(temp_path, repo->path_workdir); git_futils_direach(temp_path, GIT_PATH_MAX, dirent_cb, &dirent_st); - memset(&zero, 0x0, sizeof(git_oid)); for (i = 0; i < entries.length; ++i) { e = (struct status_entry *)git_vector_get(&entries, i); From 8f643ce8e3ec02afa1f145fa820e10a825a4c603 Mon Sep 17 00:00:00 2001 From: Luc Bertrand Date: Wed, 3 Aug 2011 13:44:28 +0200 Subject: [PATCH 3/3] Remove duplicated sort --- src/status.c | 1 - src/tree.c | 1 - 2 files changed, 2 deletions(-) diff --git a/src/status.c b/src/status.c index 50810a057..d9613c129 100644 --- a/src/status.c +++ b/src/status.c @@ -61,7 +61,6 @@ static int status_srch(const void *key, const void *array_member) static int find_status_entry(git_vector *entries, const char *path) { - git_vector_sort(entries); return git_vector_bsearch2(entries, status_srch, path); } diff --git a/src/tree.c b/src/tree.c index 8e370667d..d993d549a 100644 --- a/src/tree.c +++ b/src/tree.c @@ -426,7 +426,6 @@ static git_tree_entry *treebuilder_get(git_treebuilder *bld, const char *filenam if (build_ksearch(&ksearch, filename) < GIT_SUCCESS) return NULL; - sort_entries(bld); idx = git_vector_bsearch2(&bld->entries, entry_search_cmp, &ksearch); if (idx == GIT_ENOTFOUND) return NULL;