Skip to content

Commit 0d32ae8

Browse files
jerry-skydiogitster
authored andcommitted
builtin: patch-id: remove unused diff-tree prefix
The last git version that had "diff-tree" in the header text of "git diff-tree" output was v1.3.0 from 2006. The header text was changed from "diff-tree" to "commit" in 9153983 ("Log message printout cleanups"). Given how long ago this change was made, it is highly unlikely that anyone is still feeding in outputs from that git version. Remove the handling of the "diff-tree" prefix and document the source of the other prefixes so that the overall functionality is more clear. Signed-off-by: Jerry Zhang <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2871f4d commit 0d32ae8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

builtin/patch-id.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ static int get_one_patchid(struct object_id *next_oid, struct object_id *result,
7474
const char *p = line;
7575
int len;
7676

77-
if (!skip_prefix(line, "diff-tree ", &p) &&
78-
!skip_prefix(line, "commit ", &p) &&
77+
/* Possibly skip over the prefix added by "log" or "format-patch" */
78+
if (!skip_prefix(line, "commit ", &p) &&
7979
!skip_prefix(line, "From ", &p) &&
8080
starts_with(line, "\\ ") && 12 < strlen(line)) {
8181
if (verbatim)

0 commit comments

Comments
 (0)