summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-01-05 23:42:07 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-01-05 23:42:07 -0800
commit971e829cd84cf95203cec44d22d0e009f98ddbf5 (patch)
treecb444c4dec360e625709b3a1db91d1e99acf9197 /git.c
parentMerge branch 'jk/error-const-return' (diff)
parentadd global --literal-pathspecs option (diff)
downloadtgif-971e829cd84cf95203cec44d22d0e009f98ddbf5.tar.xz
Merge branch 'jk/pathspec-literal'
Allow scripts to feed literal paths to commands that take pathspecs, by disabling wildcard globbing. * jk/pathspec-literal: add global --literal-pathspecs option Conflicts: dir.c
Diffstat (limited to 'git.c')
-rw-r--r--git.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/git.c b/git.c
index d33f9b32a2..ed66c660d1 100644
--- a/git.c
+++ b/git.c
@@ -135,6 +135,14 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
git_config_push_parameter((*argv)[1]);
(*argv)++;
(*argc)--;
+ } else if (!strcmp(cmd, "--literal-pathspecs")) {
+ setenv(GIT_LITERAL_PATHSPECS_ENVIRONMENT, "1", 1);
+ if (envchanged)
+ *envchanged = 1;
+ } else if (!strcmp(cmd, "--no-literal-pathspecs")) {
+ setenv(GIT_LITERAL_PATHSPECS_ENVIRONMENT, "0", 1);
+ if (envchanged)
+ *envchanged = 1;
} else {
fprintf(stderr, "Unknown option: %s\n", cmd);
usage(git_usage_string);