Skip to content

Commit

Permalink
ignore new git-diff index header when computing patch ids
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kai Ruemmler authored and Junio C Hamano committed Oct 9, 2005
1 parent 5a6850e commit 9fabded
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions patch-id.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ static void generate_id_list(void)
if (!patchlen && memcmp(line, "diff ", 5))
continue;

/* Ignore git-diff index header */
if (!memcmp(line, "index ", 6))
continue;

/* Ignore line numbers when computing the SHA1 of the patch */
if (!memcmp(line, "@@ -", 4))
continue;
Expand Down

0 comments on commit 9fabded

Please sign in to comment.