aboutsummaryrefslogtreecommitdiffstats
path: root/git.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-03-07 15:59:40 -0800
committerJunio C Hamano <gitster@pobox.com>2024-03-07 15:59:40 -0800
commit2c206fc82abb3ae3d8a5fb5b3c07c1a933007f31 (patch)
tree55466cec9abcec3afafe741324490c2c47367d3a /git.c
parent43072b4ca132437f21975ac6acc6b72dc22fd398 (diff)
parente6d5479e7ac301ae8d11daa3d8ef748e891c91c3 (diff)
downloadgit-2c206fc82abb3ae3d8a5fb5b3c07c1a933007f31.tar.gz
Merge branch 'jc/no-lazy-fetch'
"git --no-lazy-fetch cmd" allows to run "cmd" while disabling lazy fetching of objects from the promisor remote, which may be handy for debugging. * jc/no-lazy-fetch: git: extend --no-lazy-fetch to work across subprocesses git: document GIT_NO_REPLACE_OBJECTS environment variable git: --no-lazy-fetch option
Diffstat (limited to 'git.c')
-rw-r--r--git.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/git.c b/git.c
index 7068a184b0..5265f920f1 100644
--- a/git.c
+++ b/git.c
@@ -4,6 +4,7 @@
#include "exec-cmd.h"
#include "gettext.h"
#include "help.h"
+#include "object-file.h"
#include "pager.h"
#include "read-cache-ll.h"
#include "run-command.h"
@@ -186,6 +187,11 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
use_pager = 0;
if (envchanged)
*envchanged = 1;
+ } else if (!strcmp(cmd, "--no-lazy-fetch")) {
+ fetch_if_missing = 0;
+ setenv(NO_LAZY_FETCH_ENVIRONMENT, "1", 1);
+ if (envchanged)
+ *envchanged = 1;
} else if (!strcmp(cmd, "--no-replace-objects")) {
disable_replace_refs();
setenv(NO_REPLACE_OBJECTS_ENVIRONMENT, "1", 1);