X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=apply.c;h=acecf8de54e0446c16da2291de6d90b4606f3287;hb=0111ea38cbb9db0e4e245dcd5c86198186bab197;hp=269210a578262b22fbf50bbdd9bf9fbccec3202b;hpb=b5b1442ac35706ce1e3daed407dd935f0e9dd796;p=git.git diff --git a/apply.c b/apply.c index 269210a5..acecf8de 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" @@ -1717,6 +1718,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); } unlink(patch->old_name); } @@ -1813,8 +1815,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)