builtin/replace: unset read_replace_refs
commit769a4fa463bb36ba78eb318f25e0e211f4fae949
authorChristian Couder <chriscool@tuxfamily.org>
Wed, 11 Dec 2013 07:46:12 +0000 (11 08:46 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 Dec 2013 19:53:49 +0000 (12 11:53 -0800)
tree6199547f8cab26c70d82481e978c81cd6df22592
parentbbbb4afc26cd3d711e07a345d1e5f9eedc68100f
builtin/replace: unset read_replace_refs

When checking to see if some objects are of the same type
and when displaying the type of objects, git replace uses
the sha1_object_info() function.

Unfortunately this function by default respects replace
refs, so instead of the type of a replaced object, it
gives the type of the replacement object which might
be different.

To fix this bug, and because git replace should work at a
level before replacement takes place, let's unset the
read_replace_refs global variable at the beginning of
cmd_replace().

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/replace.c
t/t6050-replace.sh