replace: check mergetags when using --graft
authorChristian Couder <chriscool@tuxfamily.org>
Sat, 19 Jul 2014 15:01:14 +0000 (17:01 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Jul 2014 19:06:49 +0000 (12:06 -0700)
When using --graft, with a mergetag in the original
commit, we should check that the commit pointed to by
the mergetag is still a parent of then new commit we
create, otherwise the mergetag could be misleading.

If the commit pointed to by the mergetag is no more
a parent of the new commit, we could remove the
mergetag, but in this case there is a good chance
that the title or other elements of the commit might
also be misleading. So let's just error out and
suggest to use --edit instead on the commit.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found