summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-10-03 06:42:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-10-03 06:42:49 (GMT)
commitd4e93836a6a072e392b20d7daf604fd41e15ecf9 (patch)
tree69f37e3a5a7239b416a0c75b9d52114cb9e048d3 /git.c
parentd9ec072a2903f31a0e1afde4125f62b9fc57f620 (diff)
parent27344d6a6c8056664966e11acf674e5da6dd7ee3 (diff)
downloadgit-d4e93836a6a072e392b20d7daf604fd41e15ecf9.zip
git-d4e93836a6a072e392b20d7daf604fd41e15ecf9.tar.gz
git-d4e93836a6a072e392b20d7daf604fd41e15ecf9.tar.bz2
Merge branch 'jk/no-optional-locks'
Some commands (most notably "git status") makes an opportunistic update when performing a read-only operation to help optimize later operations in the same repository. The new "--no-optional-locks" option can be passed to Git to disable them. * jk/no-optional-locks: git: add --no-optional-locks option
Diffstat (limited to 'git.c')
-rw-r--r--git.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/git.c b/git.c
index f31dca6..9e96dd4 100644
--- a/git.c
+++ b/git.c
@@ -182,6 +182,10 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
setenv(GIT_ICASE_PATHSPECS_ENVIRONMENT, "1", 1);
if (envchanged)
*envchanged = 1;
+ } else if (!strcmp(cmd, "--no-optional-locks")) {
+ setenv(GIT_OPTIONAL_LOCKS_ENVIRONMENT, "0", 1);
+ if (envchanged)
+ *envchanged = 1;
} else if (!strcmp(cmd, "--shallow-file")) {
(*argv)++;
(*argc)--;