aboutsummaryrefslogtreecommitdiff
path: root/dump-cache-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-04-24 21:18:58 -0700
committerJunio C Hamano <junkio@cox.net>2006-04-24 21:24:13 -0700
commitbad68ec92410cf47dd001aa9b95d0f24c5f4bf77 (patch)
tree9c3ef1388867852e706dbf9a4ba9cc6a8ec15bfe /dump-cache-tree.c
parentdd0c34c46bdda0c20fd92d00516e711a4c9f7837 (diff)
downloadgit-bad68ec92410cf47dd001aa9b95d0f24c5f4bf77.tar.gz
git-bad68ec92410cf47dd001aa9b95d0f24c5f4bf77.tar.xz
index: make the index file format extensible.
... and move the cache-tree data into it. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'dump-cache-tree.c')
-rw-r--r--dump-cache-tree.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/dump-cache-tree.c b/dump-cache-tree.c
index 80f8683f3..01e8bff0e 100644
--- a/dump-cache-tree.c
+++ b/dump-cache-tree.c
@@ -2,12 +2,11 @@
#include "tree.h"
#include "cache-tree.h"
-static unsigned char active_cache_sha1[20];
-static struct cache_tree *active_cache_tree;
-
static void dump_cache_tree(struct cache_tree *it, const char *pfx)
{
int i;
+ if (!it)
+ return;
if (it->entry_count < 0)
printf("%-40s %s\n", "invalid", pfx);
else
@@ -24,9 +23,8 @@ static void dump_cache_tree(struct cache_tree *it, const char *pfx)
int main(int ac, char **av)
{
- if (read_cache_1(active_cache_sha1) < 0)
+ if (read_cache() < 0)
die("unable to read index file");
- active_cache_tree = read_cache_tree(active_cache_sha1);
dump_cache_tree(active_cache_tree, "");
return 0;
}