]> Pileus Git - ~andy/git/commitdiff
Take binary diffs into account for "git rebase"
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 18 Aug 2007 22:52:55 +0000 (15:52 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 19 Aug 2007 18:45:31 +0000 (11:45 -0700)
We used to not generate a patch ID for binary diffs, but that means that
some commits may be skipped as being identical to already-applied diffs
when doing a rebase.

So just delete the code that skips the binary diff. At the very least,
we'd want the filenames to be part of the patch ID, but we might also want
to generate some hash for the binary diff itself too.

This fixes an issue noticed by Torgil Svensson.

Tested-by: Torgil Svensson <torgil.svensson@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c

diff --git a/diff.c b/diff.c
index 97cc5bc085ba21693007328bb402860420949ec0..a7e76719d12a9083c465d60eee333aa880b5a1c2 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -2919,10 +2919,6 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
                                fill_mmfile(&mf2, p->two) < 0)
                        return error("unable to read files to diff");
 
-               /* Maybe hash p->two? into the patch id? */
-               if (diff_filespec_is_binary(p->two))
-                       continue;
-
                len1 = remove_space(p->one->path, strlen(p->one->path));
                len2 = remove_space(p->two->path, strlen(p->two->path));
                if (p->one->mode == 0)