pathspec: make --literal-pathspecs disable pathspec magic
--literal-pathspecs and its equivalent environment variable are probably used for scripting. In that setting, pathspec magic may be unwanted. Disabling globbing in individual pathspec can be done via :(literal) magic. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
5c6933d201
commit
a16bf9dd74
@ -103,7 +103,7 @@ static unsigned prefix_pathspec(struct pathspec_item *item,
|
||||
if (literal_global)
|
||||
global_magic |= PATHSPEC_LITERAL;
|
||||
|
||||
if (elt[0] != ':') {
|
||||
if (elt[0] != ':' || literal_global) {
|
||||
; /* nothing to do */
|
||||
} else if (elt[1] == '(') {
|
||||
/* longhand */
|
||||
|
||||
Reference in New Issue
Block a user