apply: factor out checkout_target() helper function
commitf4c66eeddd37d3e5f4043df89c2679fbadeb57bd
authorJunio C Hamano <gitster@pobox.com>
Wed, 13 Jun 2012 05:47:12 +0000 (12 22:47 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Jul 2012 21:36:26 +0000 (9 14:36 -0700)
treefe64f3b19cc92d22e5fdcbcccfb5f4fa0e61b70d
parente42a96e7726365557b5865957927dc1ca272cad2
apply: factor out checkout_target() helper function

When a patch wants to touch a path, if the path exists in the index
but is missing in the working tree, "git apply --index" checks out
the file to the working tree from the index automatically and then
applies the patch.

Split this logic out to a separate helper function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/apply.c