Move try_merge_command and checkout_fast_forward to libgit.a

These functions are called in sequencer.c, which is part of
libgit.a. This makes libgit.a potentially require builtin/merge.c for
external git commands.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
This commit is contained in:
Nguyễn Thái Ngọc Duy
2012-10-26 22:53:49 +07:00
committed by Jeff King
parent 2cfceefaca
commit db699a8a1f
6 changed files with 125 additions and 112 deletions

View File

@ -191,7 +191,7 @@ static int fast_forward_to(const unsigned char *to, const unsigned char *from)
struct ref_lock *ref_lock;
read_cache();
if (checkout_fast_forward(from, to))
if (checkout_fast_forward(from, to, 1))
exit(1); /* the callee should have complained already */
ref_lock = lock_any_ref_for_update("HEAD", from, 0);
return write_ref_sha1(ref_lock, to, "cherry-pick");