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 <jeremy.wyman@microsoft.com>
This commit is contained in:
J Wyman
2016-12-19 10:31:37 -05:00
committed by Johannes Schindelin
parent ed507a530c
commit fe9d5900a1

View File

@@ -1378,6 +1378,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;