Merge branch 'jc/apply' into next
authorJunio C Hamano <junkio@cox.net>
Tue, 16 May 2006 00:58:02 +0000 (17:58 -0700)
committerJunio C Hamano <junkio@cox.net>
Tue, 16 May 2006 00:58:02 +0000 (17:58 -0700)
* jc/apply:
  git-am: use apply --cached
  apply --cached: apply a patch without using working tree.

1  2 
apply.c
git-am.sh

diff --cc apply.c
+++ b/apply.c
@@@ -1894,9 -1915,9 +1916,10 @@@ static void remove_file(struct patch *p
        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);
+       if (!cached)
+               unlink(patch->old_name);
  }
  
  static void add_index_file(const char *path, unsigned mode, void *buf, unsigned long size)
diff --cc git-am.sh
Simple merge