summaryrefslogtreecommitdiff
path: root/apply.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2006-05-20 00:56:11 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2006-05-20 00:56:11 -0700
commit283c8eef6c9a4e379c73904d2bc22b19341b15c8 (patch)
tree80eb9553f23256e1f1cbb6ba022b330a8a6a4422 /apply.c
parentMerge branch 'js/fetchconfig' (diff)
parentFix crash when reading the empty tree (diff)
downloadtgif-283c8eef6c9a4e379c73904d2bc22b19341b15c8.tar.xz
Merge branch 'jc/cache-tree' into jc/dirwalk-n-cache-tree
* jc/cache-tree: (24 commits) Fix crash when reading the empty tree fsck-objects: do not segfault on missing tree in cache-tree cache-tree: a bit more debugging support. read-tree: invalidate cache-tree entry when a new index entry is added. Fix test-dump-cache-tree in one-tree disappeared case. fsck-objects: mark objects reachable from cache-tree cache-tree: replace a sscanf() by two strtol() calls cache-tree.c: typefix test-dump-cache-tree: validate the cached data as well. cache_tree_update: give an option to update cache-tree only. read-tree: teach 1-way merege and plain read to prime cache-tree. read-tree: teach 1 and 2 way merges about cache-tree. update-index: when --unresolve, smudge the relevant cache-tree entries. test-dump-cache-tree: report number of subtrees. cache-tree: sort the subtree entries. Teach fsck-objects about cache-tree. index: make the index file format extensible. cache-tree: protect against "git prune". Add test-dump-cache-tree Use cache-tree in update-index. ...
Diffstat (limited to 'apply.c')
-rw-r--r--apply.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/apply.c b/apply.c
index 0ed9d132e8..5341e30922 100644
--- a/apply.c
+++ b/apply.c
@@ -8,6 +8,7 @@
*/
#include <fnmatch.h>
#include "cache.h"
+#include "cache-tree.h"
#include "quote.h"
#include "blob.h"
#include "delta.h"
@@ -1917,6 +1918,7 @@ static void remove_file(struct patch *patch)
if (write_index) {
if (remove_file_from_cache(patch->old_name) < 0)
die("unable to remove %s from index", patch->old_name);
+ cache_tree_invalidate_path(active_cache_tree, patch->old_name);
}
if (!cached)
unlink(patch->old_name);
@@ -2018,8 +2020,9 @@ static void create_file(struct patch *patch)
if (!mode)
mode = S_IFREG | 0644;
- create_one_file(path, mode, buf, size);
+ create_one_file(path, mode, buf, size);
add_index_file(path, mode, buf, size);
+ cache_tree_invalidate_path(active_cache_tree, path);
}
static void write_out_one_result(struct patch *patch)