diff options
author | Christian Couder <chriscool@tuxfamily.org> | 2009-11-18 07:50:58 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-11-20 22:08:10 -0800 |
commit | 6476b38b1f3d258006566c3c9c6c80cc07fda354 (patch) | |
tree | aa87937dc0da79a66512825ead214bf84deeadae /environment.c | |
parent | Merge branch 'np/maint-sideband-favor-status' (diff) | |
download | tgif-6476b38b1f3d258006566c3c9c6c80cc07fda354.tar.xz |
replace: use a GIT_NO_REPLACE_OBJECTS env variable
This has the same effect as --no-replace-objects option; git ignores the
replace refs. When --no-replace-objects option is passed to git, this
environment variable is set to "1" and exported to subprocesses in order
to propagate the same setting.
It is useful for example for scripts, as the git commands used in them can
now be aware that they must not read replace refs.
Tested-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'environment.c')
-rw-r--r-- | environment.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/environment.c b/environment.c index 5de6837840..5946f385f5 100644 --- a/environment.c +++ b/environment.c @@ -83,6 +83,8 @@ static void setup_git_env(void) git_graft_file = getenv(GRAFT_ENVIRONMENT); if (!git_graft_file) git_graft_file = git_pathdup("info/grafts"); + if (getenv(NO_REPLACE_OBJECTS_ENVIRONMENT)) + read_replace_refs = 0; } int is_bare_repository(void) |