Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2013-12-11 11:46:12 +0400
committerJunio C Hamano <gitster@pobox.com>2013-12-12 23:53:49 +0400
commit769a4fa463bb36ba78eb318f25e0e211f4fae949 (patch)
tree6199547f8cab26c70d82481e978c81cd6df22592 /builtin/replace.c
parentbbbb4afc26cd3d711e07a345d1e5f9eedc68100f (diff)
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>
Diffstat (limited to 'builtin/replace.c')
-rw-r--r--builtin/replace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/replace.c b/builtin/replace.c
index 9f3619a1bf..1672870e81 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -174,6 +174,8 @@ int cmd_replace(int argc, const char **argv, const char *prefix)
OPT_END()
};
+ read_replace_refs = 0;
+
argc = parse_options(argc, argv, prefix, options, git_replace_usage, 0);
if (list && delete)