summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d8c3d03)
raw | patch | inline | side by side (parent: d8c3d03)
author | Junio C Hamano <gitster@pobox.com> | |
Fri, 29 Jun 2007 05:56:07 +0000 (22:56 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 1 Jul 2007 03:51:31 +0000 (20:51 -0700) |
diffcore-break and diffcore-rename would want to behave slightly
differently depending on the binary-ness of the data, so add one
bit to the filespec, as the structure is now passed down to
diffcore_count_changes() function.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
differently depending on the binary-ness of the data, so add one
bit to the filespec, as the structure is now passed down to
diffcore_count_changes() function.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c | patch | blob | history | |
diffcore.h | patch | blob | history |
index 9938969fa50e8af2a4eabe96ae122111ae42fe75..74c1198e6790de1fd57f2af12847f152db1cac95 100644 (file)
--- a/diff.c
+++ b/diff.c
{
if (options->quiet)
return;
+
+ /*
+ * break/rename count similarity differently depending on
+ * the binary-ness.
+ */
+ if ((options->break_opt != -1) || (options->detect_rename)) {
+ struct diff_queue_struct *q = &diff_queued_diff;
+ int i;
+
+ for (i = 0; i < q->nr; i++) {
+ struct diff_filepair *p = q->queue[i];
+ p->one->is_binary = file_is_binary(p->one);
+ p->two->is_binary = file_is_binary(p->two);
+ }
+ }
+
if (options->break_opt != -1)
diffcore_break(options->break_opt);
if (options->detect_rename)
diff --git a/diffcore.h b/diffcore.h
index 990dec50f1e6ea4649800c7778fadb78883d5ea4..0c8abb5b94dc07769e5cd2603988dad6e6869bb7 100644 (file)
--- a/diffcore.h
+++ b/diffcore.h
#define DIFF_FILE_VALID(spec) (((spec)->mode) != 0)
unsigned should_free : 1; /* data should be free()'ed */
unsigned should_munmap : 1; /* data should be munmap()'ed */
+ unsigned is_binary : 1; /* data should be considered "binary" */
};
extern struct diff_filespec *alloc_filespec(const char *);