aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-07-09 00:52:36 -0700
committerJunio C Hamano <junkio@cox.net>2006-07-09 00:52:36 -0700
commit88f0d5d7d95f815d2e8a36a8ceb7459dbd90992c (patch)
tree926ba840250be0456f868099bf4a498c64c51e2f /diff.c
parentf3aafa4db29c3d4799eeeda21efaf15d364ae59a (diff)
parentd507bb15008d6ee657eebaf2803bf0964af12c93 (diff)
downloadgit-88f0d5d7d95f815d2e8a36a8ceb7459dbd90992c.tar.gz
git-88f0d5d7d95f815d2e8a36a8ceb7459dbd90992c.tar.xz
Merge branch 'sf/diff'
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index aab246c97..3e26180f0 100644
--- a/diff.c
+++ b/diff.c
@@ -729,7 +729,7 @@ static void builtin_diff(const char *name_a,
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))
@@ -1567,6 +1567,9 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
options->output_format |= DIFF_FORMAT_PATCH;
options->full_index = options->binary = 1;
}
+ else if (!strcmp(arg, "-a") || !strcmp(arg, "--text")) {
+ options->text = 1;
+ }
else if (!strcmp(arg, "--name-only"))
options->output_format |= DIFF_FORMAT_NAME;
else if (!strcmp(arg, "--name-status"))