aboutsummaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorPetr Baudis <pasky@suse.cz>2006-07-03 22:48:03 +0200
committerJunio C Hamano <junkio@cox.net>2006-07-09 01:20:01 -0700
commit0270083ded143fd49841e3d3d0cac5eb06081d2a (patch)
tree960e1b85a2b18225a466bbf4aff040b27c581594 /cache.h
parent998c4daaf4a921fb03d478b50d6e06223326d7ef (diff)
downloadgit-0270083ded143fd49841e3d3d0cac5eb06081d2a.tar.gz
git-0270083ded143fd49841e3d3d0cac5eb06081d2a.tar.xz
Make it possible to set up libgit directly (instead of from the environment)
This introduces a setup_git() function which is essentialy a (public) backend for setup_git_env() which lets anyone specify custom sources for the various paths instead of environment variables. Since the repositories may get switched on the fly, this also updates code that caches paths to invalidate them properly; I hope neither of those is a sweet spot. It is used by Git.xs' xs__call_gate() to set up per-repository data for libgit's consumption. No code actually takes advantage of it yet but get_object() will in the next patches. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 87199396a..962f2fc34 100644
--- a/cache.h
+++ b/cache.h
@@ -116,6 +116,9 @@ extern struct cache_entry **active_cache;
extern unsigned int active_nr, active_alloc, active_cache_changed;
extern struct cache_tree *active_cache_tree;
+extern void setup_git(char *new_git_dir, char *new_git_object_dir,
+ char *new_git_index_file, char *new_git_graft_file);
+
#define GIT_DIR_ENVIRONMENT "GIT_DIR"
#define DEFAULT_GIT_DIR_ENVIRONMENT ".git"
#define DB_ENVIRONMENT "GIT_OBJECT_DIRECTORY"