environment: add global variable to disable replacement

This new "read_replace_refs" global variable is set to 1 by
default, so that replace refs are used by default. But
reachability traversal and packing commands ("cmd_fsck",
"cmd_prune", "cmd_pack_objects", "upload_pack",
"cmd_unpack_objects") set it to 0, as they must work with the
original DAG.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Christian Couder
2009-01-23 10:07:46 +01:00
committed by Junio C Hamano
parent cc400f5011
commit dae556bdb1
9 changed files with 35 additions and 0 deletions

View File

@ -495,6 +495,8 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix)
int i;
unsigned char sha1[20];
read_replace_refs = 0;
git_config(git_default_config, NULL);
quiet = !isatty(2);