mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
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>
This commit is contained in:
parent
7da3bf372c
commit
fd1c3bf053
|
@ -205,7 +205,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < dir.nr; i++)
|
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 (active_cache_changed) {
|
||||||
if (write_cache(newfd, active_cache, active_nr) ||
|
if (write_cache(newfd, active_cache, active_nr) ||
|
||||||
|
|
|
@ -273,7 +273,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
|
||||||
|
|
||||||
for (i = 0; i < added.nr; i++) {
|
for (i = 0; i < added.nr; i++) {
|
||||||
const char *path = added.items[i].path;
|
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++) {
|
for (i = 0; i < deleted.nr; i++) {
|
||||||
|
|
2
cache.h
2
cache.h
|
@ -187,7 +187,7 @@ extern int add_cache_entry(struct cache_entry *ce, int option);
|
||||||
extern struct cache_entry *refresh_cache_entry(struct cache_entry *ce, int really);
|
extern struct cache_entry *refresh_cache_entry(struct cache_entry *ce, int really);
|
||||||
extern int remove_cache_entry_at(int pos);
|
extern int remove_cache_entry_at(int pos);
|
||||||
extern int remove_file_from_cache(const char *path);
|
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_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_match_stat(struct cache_entry *ce, struct stat *st, int);
|
||||||
extern int ce_modified(struct cache_entry *ce, struct stat *st, int);
|
extern int ce_modified(struct cache_entry *ce, struct stat *st, int);
|
||||||
|
|
|
@ -325,7 +325,7 @@ int remove_file_from_cache(const char *path)
|
||||||
return 0;
|
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;
|
int size, namelen;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
Loading…
Reference in a new issue