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
path: root/git.c
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2009-11-18 09:50:58 +0300
committerJunio C Hamano <gitster@pobox.com>2009-11-21 09:08:10 +0300
commit6476b38b1f3d258006566c3c9c6c80cc07fda354 (patch)
treeaa87937dc0da79a66512825ead214bf84deeadae /git.c
parente36e6c00cd60130f8792319a5aa0f56d2da68e14 (diff)
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 'git.c')
-rw-r--r--git.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/git.c b/git.c
index bd2c5fe77b..d50bbc3e43 100644
--- a/git.c
+++ b/git.c
@@ -89,6 +89,9 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
*envchanged = 1;
} else if (!strcmp(cmd, "--no-replace-objects")) {
read_replace_refs = 0;
+ setenv(NO_REPLACE_OBJECTS_ENVIRONMENT, "1", 1);
+ if (envchanged)
+ *envchanged = 1;
} else if (!strcmp(cmd, "--git-dir")) {
if (*argc < 2) {
fprintf(stderr, "No directory given for --git-dir.\n" );