From: "AreaZR via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: AreaZR <gfunni234@gmail.com>, Seija Kijin <doremylover123@gmail.com>
Subject: [PATCH] pathsec: make check for PATHSPEC_LITERAL more readable
Date: Wed, 18 Dec 2024 03:53:12 +0000 [thread overview]
Message-ID: <pull.1453.git.git.1734493992236.gitgitgadget@gmail.com> (raw)
From: Seija Kijin <doremylover123@gmail.com>
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 <doremylover123@gmail.com>
---
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.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1453%2FAreaZR%2Fredundant-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1453/AreaZR/redundant-v1
Pull-Request: https://github.com/git/git/pull/1453
pathspec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pathspec.c b/pathspec.c
index 0fc6f84a6e6..0af953d055d 100644
--- a/pathspec.c
+++ b/pathspec.c
@@ -313,7 +313,7 @@ static int get_global_magic(int element_magic)
global_magic |= PATHSPEC_ICASE;
if ((global_magic & PATHSPEC_LITERAL) &&
- (global_magic & ~PATHSPEC_LITERAL))
+ (global_magic != PATHSPEC_LITERAL))
die(_("global 'literal' pathspec setting is incompatible "
"with all other global pathspec settings"));
base-commit: d882f382b3d939d90cfa58d17b17802338f05d66
--
gitgitgadget
next reply other threads:[~2024-12-18 3:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-18 3:53 AreaZR via GitGitGadget [this message]
2024-12-18 4:43 ` [PATCH] pathsec: make check for PATHSPEC_LITERAL more readable Kristoffer Haugsbakk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.1453.git.git.1734493992236.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=doremylover123@gmail.com \
--cc=gfunni234@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox