summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6bdca89)
raw | patch | inline | side by side (parent: 6bdca89)
author | Stephan Feder <sf@b-i-t.de> | |
Fri, 7 Jul 2006 10:33:57 +0000 (12:33 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 7 Jul 2006 19:28:04 +0000 (12:28 -0700) |
Add new item text to struct diff_options.
If set then do not try to detect binary files.
Signed-off-by: Stephan Feder <sf@b-i-t.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
If set then do not try to detect binary files.
Signed-off-by: Stephan Feder <sf@b-i-t.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff.c | patch | blob | history | |
diff.h | patch | blob | history |
index f0450a8b0bcefc336b6aa5e3d5122c1a3a39b1a4..1f0219dbe40e6c750766d8c7694af47fbdc854d2 100644 (file)
--- a/diff.c
+++ b/diff.c
if (fill_mmfile(&mf1, one) < 0 || fill_mmfile(&mf2, two) < 0)
die("unable to read files to diff");
- if (mmfile_is_binary(&mf1) || mmfile_is_binary(&mf2)) {
+ if (!o->text && (mmfile_is_binary(&mf1) || mmfile_is_binary(&mf2))) {
/* Quite common confusing case */
if (mf1.size == mf2.size &&
!memcmp(mf1.ptr, mf2.ptr, mf1.size))
options->output_format |= DIFF_FORMAT_PATCH;
options->full_index = options->binary = 1;
}
+ else if (!strcmp(arg, "--text")) {
+ options->text = 1;
+ }
else if (!strcmp(arg, "--name-only"))
options->output_format |= DIFF_FORMAT_NAME;
else if (!strcmp(arg, "--name-status"))