summaryrefslogtreecommitdiff
path: root/cache-tree.h
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-05-20 00:56:11 -0700
committerJunio C Hamano <junkio@cox.net>2006-05-20 00:56:11 -0700
commit283c8eef6c9a4e379c73904d2bc22b19341b15c8 (patch)
tree80eb9553f23256e1f1cbb6ba022b330a8a6a4422 /cache-tree.h
parent288c0384505e6c25cc1a162242919a0485d50a74 (diff)
parentb6c4a480b3161effaa3578df91d8cdc83044d7b6 (diff)
downloadgit-283c8eef6c9a4e379c73904d2bc22b19341b15c8.tar.gz
Merge branch 'jc/cache-tree' into jc/dirwalk-n-cache-tree
* jc/cache-tree: (24 commits) Fix crash when reading the empty tree fsck-objects: do not segfault on missing tree in cache-tree cache-tree: a bit more debugging support. read-tree: invalidate cache-tree entry when a new index entry is added. Fix test-dump-cache-tree in one-tree disappeared case. fsck-objects: mark objects reachable from cache-tree cache-tree: replace a sscanf() by two strtol() calls cache-tree.c: typefix test-dump-cache-tree: validate the cached data as well. cache_tree_update: give an option to update cache-tree only. read-tree: teach 1-way merege and plain read to prime cache-tree. read-tree: teach 1 and 2 way merges about cache-tree. update-index: when --unresolve, smudge the relevant cache-tree entries. test-dump-cache-tree: report number of subtrees. cache-tree: sort the subtree entries. Teach fsck-objects about cache-tree. index: make the index file format extensible. cache-tree: protect against "git prune". Add test-dump-cache-tree Use cache-tree in update-index. ...
Diffstat (limited to 'cache-tree.h')
-rw-r--r--cache-tree.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/cache-tree.h b/cache-tree.h
new file mode 100644
index 0000000000..72c64801f5
--- /dev/null
+++ b/cache-tree.h
@@ -0,0 +1,31 @@
+#ifndef CACHE_TREE_H
+#define CACHE_TREE_H
+
+struct cache_tree;
+struct cache_tree_sub {
+ struct cache_tree *cache_tree;
+ int namelen;
+ int used;
+ char name[FLEX_ARRAY];
+};
+
+struct cache_tree {
+ int entry_count; /* negative means "invalid" */
+ unsigned char sha1[20];
+ int subtree_nr;
+ int subtree_alloc;
+ struct cache_tree_sub **down;
+};
+
+struct cache_tree *cache_tree(void);
+void cache_tree_free(struct cache_tree **);
+void cache_tree_invalidate_path(struct cache_tree *, const char *);
+struct cache_tree_sub *cache_tree_sub(struct cache_tree *, const char *);
+
+void *cache_tree_write(struct cache_tree *root, unsigned long *size_p);
+struct cache_tree *cache_tree_read(const char *buffer, unsigned long size);
+
+int cache_tree_fully_valid(struct cache_tree *);
+int cache_tree_update(struct cache_tree *, struct cache_entry **, int, int, int);
+
+#endif