From 30b8e93c183f2e4d085cd3ce9be7b69412980eed Mon Sep 17 00:00:00 2001 From: J Wyman Date: Mon, 19 Dec 2016 10:31:37 -0500 Subject: [PATCH] Carry non-locking status value in the environment. If the user has specified '--no-lock-index' when calling git-status, it only seems reasonable that the user intends that option to be carried through to any child forks/procs as well. Currently, the '--no-lock-status' call is lost when submodules are checked. This change places the desired option into the environment, which is in turn passed down to all subsequent children. With cmd_status checking for '--no-lock--status' first from args then from environment, we're able to keep the option set in all children. Signed-off-by: J Wyman --- builtin/commit.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/builtin/commit.c b/builtin/commit.c index 0fcb1679b4..c4d75cd7be 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1391,6 +1391,11 @@ int cmd_status(int argc, const char **argv, const char *prefix) finalize_colopts(&s.colopts, -1); finalize_deferred_config(&s); + if (no_lock_index) + setenv("GIT_LOCK_INDEX", "false", 1); + else if (!git_parse_maybe_bool(getenv("GIT_LOCK_INDEX"))) + no_lock_index = 1; + handle_untracked_files_arg(&s); if (show_ignored_in_status) s.show_ignored_files = 1;