Skip to content

Commit 9fabded

Browse files
Kai RuemmlerJunio C Hamano
authored andcommitted
ignore new git-diff index header when computing patch ids
Two else equal patches should not result in different checksums, only because they were applied to different versions of the file. Signed-off-by: Kai Ruemmler <kai.ruemmler@gmx.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 5a6850e commit 9fabded

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

patch-id.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ static void generate_id_list(void)
5555
if (!patchlen && memcmp(line, "diff ", 5))
5656
continue;
5757

58+
/* Ignore git-diff index header */
59+
if (!memcmp(line, "index ", 6))
60+
continue;
61+
5862
/* Ignore line numbers when computing the SHA1 of the patch */
5963
if (!memcmp(line, "@@ -", 4))
6064
continue;

0 commit comments

Comments
 (0)