Skip to content

Commit ffd02cd

Browse files
Seija KijinAZero13
authored andcommitted
pathsec: make check for PATHSPEC_LITERAL more readable
This check is designed to die if global_magic has the PATHSPEC_LITERAL and any other setting. This can be written is a much more obvious way: if global_magic has PATHSPEC_LITERAL, it can only BE PATHSPEC_LITERAL, and if it isn't then there are other settings. Signed-off-by: Seija Kijin <[email protected]>
1 parent d882f38 commit ffd02cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pathspec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ static int get_global_magic(int element_magic)
313313
global_magic |= PATHSPEC_ICASE;
314314

315315
if ((global_magic & PATHSPEC_LITERAL) &&
316-
(global_magic & ~PATHSPEC_LITERAL))
316+
(global_magic != PATHSPEC_LITERAL))
317317
die(_("global 'literal' pathspec setting is incompatible "
318318
"with all other global pathspec settings"));
319319

0 commit comments

Comments
 (0)