X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=cache.h;h=02b6a73117c6aaf3f10477e9afd13229fa88dd46;hb=b2c007186786c39693d42d18a1e491aa2e7defce;hp=eab355da5d2f6595053f28f0cca61181ac314ee9;hpb=ca9be05421ff3b641182ab4063c7c3ac834750b5;p=git.git diff --git a/cache.h b/cache.h index eab355da..02b6a731 100644 --- a/cache.h +++ b/cache.h @@ -1,6 +1,7 @@ #ifndef CACHE_H #define CACHE_H +#include #include #include #include @@ -10,6 +11,7 @@ #include #include #include +#include #include #include @@ -83,6 +85,13 @@ unsigned int active_nr, active_alloc; #define DB_ENVIRONMENT "SHA1_FILE_DIRECTORY" #define DEFAULT_DB_ENVIRONMENT ".git/objects" +#define get_object_directory() (getenv(DB_ENVIRONMENT) ? : DEFAULT_DB_ENVIRONMENT) + +#define INDEX_ENVIRONMENT "GIT_INDEX_FILE" +#define DEFAULT_INDEX_ENVIRONMENT ".git/index" + +#define get_index_file() (getenv(INDEX_ENVIRONMENT) ? : DEFAULT_INDEX_ENVIRONMENT) + #define alloc_nr(x) (((x)+16)*3/2) /* Initialize and use the cache information */ @@ -124,4 +133,8 @@ extern int error(const char *err, ...); extern int cache_name_compare(const char *name1, int len1, const char *name2, int len2); +extern void *read_tree_with_tree_or_commit_sha1(const unsigned char *sha1, + unsigned long *size, + unsigned char *tree_sha1_ret); + #endif /* CACHE_H */