aboutsummaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-09-14 01:19:30 -0700
committerJunio C Hamano <gitster@pobox.com>2007-09-14 01:19:30 -0700
commit58f6fb53dd1104559f6f5507562a975c0ff079af (patch)
treee5d6efb5312abab35abf8a7b18aacc61776c6592 /read-cache.c
parentcbb390cd8f58ca6fc5c7b2c710425649b057b6d6 (diff)
parent09d5dc32fbdfa7bfd23fe377455445dd2605c3b9 (diff)
downloadgit-58f6fb53dd1104559f6f5507562a975c0ff079af.tar.gz
git-58f6fb53dd1104559f6f5507562a975c0ff079af.tar.xz
Merge branch 'jc/cachetree' into cr/reset
* jc/cachetree: Simplify cache API git-format-patch --in-reply-to: accept <message@id> with angle brackets git-add -u: do not barf on type changes Remove duplicate note about removing commits with git-filter-branch git-clone: improve error message if curl program is missing or not executable git.el: Allow the add and remove commands to be applied to ignored files. git.el: Allow selecting whether to display uptodate/unknown/ignored files. git.el: Keep the status buffer sorted by filename. hooks--update: Explicitly check for all zeros for a deleted ref.
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index 536f4d087..2e40a3442 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -346,6 +346,7 @@ int remove_file_from_index(struct index_state *istate, const char *path)
int pos = index_name_pos(istate, path, strlen(path));
if (pos < 0)
pos = -pos-1;
+ cache_tree_invalidate_path(istate->cache_tree, path);
while (pos < istate->cache_nr && !strcmp(istate->cache[pos]->name, path))
remove_index_entry_at(istate, pos);
return 0;
@@ -430,7 +431,6 @@ int add_file_to_index(struct index_state *istate, const char *path, int verbose)
die("unable to add %s to index",path);
if (verbose)
printf("add '%s'\n", path);
- cache_tree_invalidate_path(istate->cache_tree, path);
return 0;
}
@@ -698,6 +698,7 @@ static int add_index_entry_with_check(struct index_state *istate, struct cache_e
int ok_to_replace = option & ADD_CACHE_OK_TO_REPLACE;
int skip_df_check = option & ADD_CACHE_SKIP_DFCHECK;
+ cache_tree_invalidate_path(istate->cache_tree, ce->name);
pos = index_name_pos(istate, ce->name, ntohs(ce->ce_flags));
/* existing match? Just replace it. */