summaryrefslogtreecommitdiff
path: root/builtin-read-tree.c
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2008-06-27 18:21:58 +0200
committerJunio C Hamano <gitster@pobox.com>2008-06-30 22:45:51 -0700
commite46bbcf6e89e4b1d3d8de1d20d836538ab0f0c85 (patch)
treeed37667a4a0f83d46f4403d0c5d28542e4c3f244 /builtin-read-tree.c
parentb2eabcc2539c021ea6cb2d1d2d28c8213986a186 (diff)
downloadgit-e46bbcf6e89e4b1d3d8de1d20d836538ab0f0c85.tar.gz
Move read_cache_unmerged() to read-cache.c
builtin-read-tree has a read_cache_unmerged() which is useful for other builtins, for example builtin-merge uses it as well. Move it to read-cache.c to avoid code duplication. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-read-tree.c')
-rw-r--r--builtin-read-tree.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/builtin-read-tree.c b/builtin-read-tree.c
index 5a09e17f1a..72a6de302f 100644
--- a/builtin-read-tree.c
+++ b/builtin-read-tree.c
@@ -29,30 +29,6 @@ static int list_tree(unsigned char *sha1)
return 0;
}
-static int read_cache_unmerged(void)
-{
- int i;
- struct cache_entry **dst;
- struct cache_entry *last = NULL;
-
- read_cache();
- dst = active_cache;
- for (i = 0; i < active_nr; i++) {
- struct cache_entry *ce = active_cache[i];
- if (ce_stage(ce)) {
- remove_name_hash(ce);
- if (last && !strcmp(ce->name, last->name))
- continue;
- cache_tree_invalidate_path(active_cache_tree, ce->name);
- last = ce;
- continue;
- }
- *dst++ = ce;
- }
- active_nr = dst - active_cache;
- return !!last;
-}
-
static void prime_cache_tree_rec(struct cache_tree *it, struct tree *tree)
{
struct tree_desc desc;