X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=apply.c;h=5341e309224b227f2fb430c448192cd7642348cf;hb=c7b345b075ee5395992f3fb9d1d860bb350256d7;hp=0ed9d132e88f52c678a4a64caf3b49d5bc04ee2e;hpb=d91d4c2c500b17d50359693a406a2c68b65330fe;p=git.git diff --git a/apply.c b/apply.c index 0ed9d132..5341e309 100644 --- a/apply.c +++ b/apply.c @@ -8,6 +8,7 @@ */ #include #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)