@matheusbsbs / matheus-bagliano / commits / fd1c3bf053
Fork 0

Rename add_file_to_index() to add_file_to_cache()

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>

Junio C Hamano committed Apr 1, 2007 at 22:14 UTC fd1c3bf0533c6cc7e44646d4e52d378d5b5a1631
4 files changed +4 -4
builtin-add.c
+1 -1
@@ -205,7 +205,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
205 }
206
207 for (i = 0; i < dir.nr; i++)
208 - add_file_to_index(dir.entries[i]->name, verbose);
208 + add_file_to_cache(dir.entries[i]->name, verbose);
209
210 if (active_cache_changed) {
211 if (write_cache(newfd, active_cache, active_nr) ||
builtin-mv.c
+1 -1
@@ -273,7 +273,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
273
274 for (i = 0; i < added.nr; i++) {
275 const char *path = added.items[i].path;
276 - add_file_to_index(path, verbose);
276 + add_file_to_cache(path, verbose);
277 }
278
279 for (i = 0; i < deleted.nr; i++) {
cache.h
+1 -1
@@ -187,7 +187,7 @@ extern int add_cache_entry(struct cache_entry *ce, int option);
187 extern struct cache_entry *refresh_cache_entry(struct cache_entry *ce, int really);
188 extern int remove_cache_entry_at(int pos);
189 extern int remove_file_from_cache(const char *path);
190 -extern int add_file_to_index(const char *path, int verbose);
190 +extern int add_file_to_cache(const char *path, int verbose);
191 extern int ce_same_name(struct cache_entry *a, struct cache_entry *b);
192 extern int ce_match_stat(struct cache_entry *ce, struct stat *st, int);
193 extern int ce_modified(struct cache_entry *ce, struct stat *st, int);
read-cache.c
+1 -1
@@ -325,7 +325,7 @@ int remove_file_from_cache(const char *path)
325 return 0;
326 }
327
328 -int add_file_to_index(const char *path, int verbose)
328 +int add_file_to_cache(const char *path, int verbose)
329 {
330 int size, namelen;
331 struct stat st;