interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / cache-tree.h

57 lines · 1885 bytes Raw Blame History
1#ifndef CACHE_TREE_H
2#define CACHE_TREE_H
3
4#include "tree.h"
5#include "tree-walk.h"
6
7struct cache_tree;
8struct cache_tree_sub {
9 struct cache_tree *cache_tree;
10 int count; /* internally used by update_one() */
11 int namelen;
12 int used;
13 char name[FLEX_ARRAY];
14};
15
16struct cache_tree {
17 int entry_count; /* negative means "invalid" */
18 struct object_id oid;
19 int subtree_nr;
20 int subtree_alloc;
21 struct cache_tree_sub **down;
22};
23
24struct cache_tree *cache_tree(void);
25void cache_tree_free(struct cache_tree **);
26void cache_tree_invalidate_path(struct index_state *, const char *);
27struct cache_tree_sub *cache_tree_sub(struct cache_tree *, const char *);
28
29int cache_tree_subtree_pos(struct cache_tree *it, const char *path, int pathlen);
30
31void cache_tree_write(struct repository *repo, struct strbuf *, struct cache_tree *root);
32struct cache_tree *cache_tree_read(struct repository *repo,
33 const char *buffer, unsigned long size);
34
35int cache_tree_fully_valid(struct index_state *);
36int cache_tree_update(struct index_state *, int);
37int cache_tree_verify(struct repository *, struct index_state *);
38
39/* bitmasks to write_index_as_tree flags */
40#define WRITE_TREE_MISSING_OK 1
41#define WRITE_TREE_IGNORE_CACHE_TREE 2
42#define WRITE_TREE_DRY_RUN 4
43#define WRITE_TREE_SILENT 8
44#define WRITE_TREE_REPAIR 16
45
46/* error return codes */
47#define WRITE_TREE_UNREADABLE_INDEX (-1)
48#define WRITE_TREE_UNMERGED_INDEX (-2)
49#define WRITE_TREE_PREFIX_ERROR (-3)
50
51struct tree *write_in_core_index_as_tree(struct repository *repo,
52 struct index_state *index_state);
53int write_index_as_tree(struct object_id *oid, struct index_state *index_state, const char *index_path, int flags, const char *prefix);
54void prime_cache_tree(struct repository *, struct index_state *, struct tree *);
55
56int cache_tree_matches_traversal(struct cache_tree *, struct name_entry *ent, struct traverse_info *info);
57#endif