summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7da3bf3)
raw | patch | inline | side by side (parent: 7da3bf3)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 2 Apr 2007 05:14:40 +0000 (22:14 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 5 Apr 2007 22:07:16 +0000 (15:07 -0700) |
This function was not called "add_file_to_cache()" only because
an ancient program, update-cache, used that name as an internal
function name that does something slightly different. Now that
is gone, we can take over the better name.
The plan is to name all functions that operate on the default
index xxx_cache(). Later patches create a variant of them that
take an explicit parameter xxx_index(), and then turn
xxx_cache() functions into macros that use "the_index".
Signed-off-by: Junio C Hamano <junkio@cox.net>
an ancient program, update-cache, used that name as an internal
function name that does something slightly different. Now that
is gone, we can take over the better name.
The plan is to name all functions that operate on the default
index xxx_cache(). Later patches create a variant of them that
take an explicit parameter xxx_index(), and then turn
xxx_cache() functions into macros that use "the_index".
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-add.c | patch | blob | history | |
builtin-mv.c | patch | blob | history | |
cache.h | patch | blob | history | |
read-cache.c | patch | blob | history |
diff --git a/builtin-add.c b/builtin-add.c
index 871e23f0f60398418f52a9c9a63e6198b5d10c15..7d1d5dc2448ef3049de30fdba1f78c49506030db 100644 (file)
--- a/builtin-add.c
+++ b/builtin-add.c
}
for (i = 0; i < dir.nr; i++)
- add_file_to_index(dir.entries[i]->name, verbose);
+ add_file_to_cache(dir.entries[i]->name, verbose);
if (active_cache_changed) {
if (write_cache(newfd, active_cache, active_nr) ||
diff --git a/builtin-mv.c b/builtin-mv.c
index 737af350b873e90c787cb49960236fc19b62a3bf..c4ab4784cece771074c43580bf1874b92b11a249 100644 (file)
--- a/builtin-mv.c
+++ b/builtin-mv.c
for (i = 0; i < added.nr; i++) {
const char *path = added.items[i].path;
- add_file_to_index(path, verbose);
+ add_file_to_cache(path, verbose);
}
for (i = 0; i < deleted.nr; i++) {
index 467e6a579aa4ef1de9df8e76cb09afa6abfe1646..ece0c041f5f4747b09bdf4300a74b5bc242a3dad 100644 (file)
--- a/cache.h
+++ b/cache.h
extern struct cache_entry *refresh_cache_entry(struct cache_entry *ce, int really);
extern int remove_cache_entry_at(int pos);
extern int remove_file_from_cache(const char *path);
-extern int add_file_to_index(const char *path, int verbose);
+extern int add_file_to_cache(const char *path, int verbose);
extern int ce_same_name(struct cache_entry *a, struct cache_entry *b);
extern int ce_match_stat(struct cache_entry *ce, struct stat *st, int);
extern int ce_modified(struct cache_entry *ce, struct stat *st, int);
diff --git a/read-cache.c b/read-cache.c
index 747b50a99a5009e64594fe4e8da11c827a8db336..a8f8a6b2b23cdba612db175ee86a5f0db125c245 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
return 0;
}
-int add_file_to_index(const char *path, int verbose)
+int add_file_to_cache(const char *path, int verbose)
{
int size, namelen;
struct stat st;