aboutsummaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-21 10:55:18 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-21 10:55:18 -0700
commitbb233d690a9782e1570dc93ead2bf04aaca7cfe4 (patch)
treefb5599a254b880afd905dcef56c639292f94b6ee /read-cache.c
parent65bb49144d26a10837582a99e66041035319ff91 (diff)
downloadgit-bb233d690a9782e1570dc93ead2bf04aaca7cfe4.tar.gz
git-bb233d690a9782e1570dc93ead2bf04aaca7cfe4.tar.xz
Add support for a "GIT_INDEX_FILE" environment variable.
We use that to specify alternative index files, which can be useful if you want to (for example) generate a temporary index file to do some specific operation that you don't want to mess with your main one with. It defaults to the regular ".git/index" if it hasn't been specified.
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index 44a713aed..4b668be47 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -188,7 +188,7 @@ int read_cache(void)
sha1_file_directory = DEFAULT_DB_ENVIRONMENT;
if (access(sha1_file_directory, X_OK) < 0)
return error("no access to SHA1 file directory");
- fd = open(".git/index", O_RDONLY);
+ fd = open(get_index_file(), O_RDONLY);
if (fd < 0)
return (errno == ENOENT) ? 0 : error("open failed");