From 3e391ca0f750992f64b57eba67ad029c5e57b288 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 eeab0b3f95748e..4528d94f9e69ed 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1373,6 +1373,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;