[PATCH v3 6/7] builtin: patch-id: remove unused diff-tree prefix
- From
Jerry Zhang via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Oct 14, 2022, 08:56 UTC
- Message-ID
- <a1f6f36d4878ade4fae1142f03e53d0cc42dfb2b.1665737804.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.1359.v3.git.1665737804.gitgitgadget@gmail.com>
From: Jerry Zhang <Jerry@skydio.com>
From a "git grep" of the repo, no command, including diff-tree itself, produces diff output with "diff-tree " prefixed in the header.
Thus remove its handling in "patch-id".
Signed-off-by: Jerry Zhang <Jerry@skydio.com> --- builtin/patch-id.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/patch-id.c b/builtin/patch-id.c index 745fe193a71..c37b8f573b7 100644 --- a/builtin/patch-id.c +++ b/builtin/patch-id.c @@ -74,8 +74,8 @@ static int get_one_patchid(struct object_id *next_oid, struct object_id *result, const char *p = line; int len; - if (!skip_prefix(line, "diff-tree ", &p) && - !skip_prefix(line, "commit ", &p) && + /* Possibly skip over the prefix added by "log" or "format-patch" */ + if (!skip_prefix(line, "commit ", &p) && !skip_prefix(line, "From ", &p) && starts_with(line, "\\ ") && 12 < strlen(line)) { if (include_whitespace)
-- gitgitgadget