builtin-am: apply patch with git-apply
commit38a824fe050c4da3f2e0979a94062119080a77a0
authorPaul Tan <pyokagan@gmail.com>
Tue, 4 Aug 2015 13:51:29 +0000 (4 21:51 +0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Aug 2015 05:02:11 +0000 (4 22:02 -0700)
tree5fa13fce27bacc6d7eff4b77ee92e8750221af92
parent3e20dcf367f551e5a0efab74e7bc2c07f0549a3d
builtin-am: apply patch with git-apply

Implement applying the patch to the index using git-apply.

If a file is unchanged but stat-dirty, git-apply may erroneously fail to
apply patches, thinking that they conflict with a dirty working tree.

As such, since 2a6f08a (am: refresh the index at start and --resolved,
2011-08-15), git-am will refresh the index before applying patches.
Re-implement this behavior.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/am.c