summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9614b8d)
raw | patch | inline | side by side (parent: 9614b8d)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Mon, 11 Apr 2005 22:47:57 +0000 (15:47 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Mon, 11 Apr 2005 22:47:57 +0000 (15:47 -0700) |
I started out calling the tool "dircache". That's clearly moronic.
README | patch | blob | history | |
cache.h | patch | blob | history | |
init-db.c | patch | blob | history | |
read-cache.c | patch | blob | history | |
read-tree.c | patch | blob | history | |
update-cache.c | patch | blob | history |
index 27577f76849c09d3405397244eb3d8ae1d11b0f3..cf550e258cff644726561052d129a03c4f7d2717 100644 (file)
--- a/README
+++ b/README
Another way of saying the same thing: "git" itself only handles content
integrity, the trust has to come from outside.
- Current Directory Cache (".dircache/index")
+ Current Directory Cache (".git/index")
The "current directory cache" is a simple binary file, which contains an
efficient representation of a virtual directory content at some random
index 4b101188d7fa074ad0cf5f4ad16eb33a43e87d24..07598d469a15db2c10d36e627c0e77dea065b8ef 100644 (file)
--- a/cache.h
+++ b/cache.h
unsigned int active_nr, active_alloc;
#define DB_ENVIRONMENT "SHA1_FILE_DIRECTORY"
-#define DEFAULT_DB_ENVIRONMENT ".dircache/objects"
+#define DEFAULT_DB_ENVIRONMENT ".git/objects"
#define cache_entry_size(len) ((offsetof(struct cache_entry,name) + (len) + 8) & ~7)
#define ce_size(ce) cache_entry_size((ce)->namelen)
diff --git a/init-db.c b/init-db.c
index bbb3ad98e0fe5739f8ae8a8d2c10352dc1281461..503e7193f34afd538568a8129a4d488eef9e33a2 100644 (file)
--- a/init-db.c
+++ b/init-db.c
char *sha1_dir = getenv(DB_ENVIRONMENT), *path;
int len, i;
- if (mkdir(".dircache", 0755) < 0) {
- perror("unable to create .dircache");
+ if (mkdir(".git", 0755) < 0) {
+ perror("unable to create .git directory");
exit(1);
}
diff --git a/read-cache.c b/read-cache.c
index 3c575f7d1c32b6845a64feec0f700bab81751a8e..54536944648c166008f06d29f65314b58b0c3988 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
sha1_file_directory = DEFAULT_DB_ENVIRONMENT;
if (access(sha1_file_directory, X_OK) < 0)
return error("no access to SHA1 file directory");
- fd = open(".dircache/index", O_RDONLY);
+ fd = open(".git/index", O_RDONLY);
if (fd < 0)
return (errno == ENOENT) ? 0 : error("open failed");
diff --git a/read-tree.c b/read-tree.c
index 5c9d38ba5812b4b8ac4a3d5acbcc274b697efcfc..dc24e91b09b7468ca40d9142b18699b10193a2f6 100644 (file)
--- a/read-tree.c
+++ b/read-tree.c
static void remove_lock_file(void)
{
if (remove_lock)
- unlink(".dircache/index.lock");
+ unlink(".git/index.lock");
}
int main(int argc, char **argv)
int i, newfd;
unsigned char sha1[20];
- newfd = open(".dircache/index.lock", O_RDWR | O_CREAT | O_EXCL, 0600);
+ newfd = open(".git/index.lock", O_RDWR | O_CREAT | O_EXCL, 0600);
if (newfd < 0)
usage("unable to create new cachefile");
atexit(remove_lock_file);
usage("failed to unpack tree object %s", arg);
}
if (write_cache(newfd, active_cache, active_nr) ||
- rename(".dircache/index.lock", ".dircache/index"))
+ rename(".git/index.lock", ".git/index"))
usage("unable to write new index file");
remove_lock = 0;
return 0;
diff --git a/update-cache.c b/update-cache.c
index ea956e47b3c5b1bb4208667ae0a4b2a8a189a05e..25db78908a672380f77a7fe704c5e707c05b6d01 100644 (file)
--- a/update-cache.c
+++ b/update-cache.c
/*
* We fundamentally don't like some paths: we don't want
* dot or dot-dot anywhere, and in fact, we don't even want
- * any other dot-files (.dircache or anything else). They
+ * any other dot-files (.git or anything else). They
* are hidden, for chist sake.
*
* Also, we don't want double slashes or slashes at the
static void remove_lock_file(void)
{
if (remove_lock)
- unlink(".dircache/index.lock");
+ unlink(".git/index.lock");
}
int main(int argc, char **argv)
int i, newfd, entries;
int allow_options = 1;
- newfd = open(".dircache/index.lock", O_RDWR | O_CREAT | O_EXCL, 0600);
+ newfd = open(".git/index.lock", O_RDWR | O_CREAT | O_EXCL, 0600);
if (newfd < 0)
usage("unable to create new cachefile");
usage("Unable to add %s to database", path);
}
if (write_cache(newfd, active_cache, active_nr) ||
- rename(".dircache/index.lock", ".dircache/index"))
+ rename(".git/index.lock", ".git/index"))
usage("Unable to write new cachefile");
remove_lock = 0;