Skip to content

Commit 7b3bdbb

Browse files
committed
fixup: do not unconditionally disable "diff -u"
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 4fdf71b commit 7b3bdbb

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,6 +1374,10 @@ ifdef USE_NED_ALLOCATOR
13741374
COMPAT_OBJS += compat/nedmalloc/nedmalloc.o
13751375
endif
13761376

1377+
ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT
1378+
export GIT_TEST_CMP_USE_COPIED_CONTEXT
1379+
endif
1380+
13771381
ifeq ($(TCLTK_PATH),)
13781382
NO_TCLTK=NoThanks
13791383
endif

t/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,10 @@
66
-include ../config.mak
77

88
#GIT_TEST_OPTS=--verbose --debug
9-
GIT_TEST_CMP ?= $(DIFF)
109
SHELL_PATH ?= $(SHELL)
1110
TAR ?= $(TAR)
1211
RM ?= rm -f
1312

14-
# Make sure test-lib.sh uses make's value of GIT_TEST_CMP
15-
export GIT_TEST_CMP
16-
1713
# Shell quote;
1814
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
1915

t/test-lib.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,16 @@ export GIT_MERGE_VERBOSITY
6363
export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
6464
export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
6565
export EDITOR
66-
GIT_TEST_CMP=${GIT_TEST_CMP:-diff -u}
66+
67+
if test -z "$GIT_TEST_CMP"
68+
then
69+
if test -n "$GIT_TEST_CMP_USE_COPIED_CONTEXT"
70+
then
71+
GIT_TEST_CMP="$DIFF -c"
72+
else
73+
GIT_TEST_CMP="$DIFF -u"
74+
fi
75+
fi
6776

6877
# Protect ourselves from common misconfiguration to export
6978
# CDPATH into the environment

0 commit comments

Comments
 (0)