Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
Add set_git_dir() function
[gitweb.git]
/
environment.c
diff --git
a/environment.c
b/environment.c
index f83fb9e44806c03cde06eede7888a4dcb901c5c3..a571fae607d56fedc5353c5e8e0206fdc4e59c06 100644
(file)
--- a/
environment.c
+++ b/
environment.c
@@
-107,3
+107,11
@@
char *get_graft_file(void)
setup_git_env();
return git_graft_file;
}
+
+int set_git_dir(const char *path)
+{
+ if (setenv(GIT_DIR_ENVIRONMENT, path, 1))
+ return error("Could not set GIT_DIR to '%s'", path);
+ setup_git_env();
+ return 0;
+}