summaryrefslogtreecommitdiff
path: root/t/t4051-diff-function-context.sh
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2017-05-08 16:03:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-09 03:24:35 (GMT)
commit33de7163879ca83be7d6e1583c125f84e1e7c329 (patch)
tree89514e7d856b482a1822b6e22c3696bb1542a075 /t/t4051-diff-function-context.sh
parent37590ce3c535f92e28da83893f843cc0099873bf (diff)
downloadgit-33de7163879ca83be7d6e1583c125f84e1e7c329.zip
git-33de7163879ca83be7d6e1583c125f84e1e7c329.tar.gz
git-33de7163879ca83be7d6e1583c125f84e1e7c329.tar.bz2
diff: enable indent heuristic by default
The feature was included in v2.11 (released 2016-11-29) and we got no negative feedback. Quite the opposite, all feedback we got was positive. Turn it on by default. Users who dislike the feature can turn it off by setting diff.indentHeuristic (which also configures plumbing commands, see prior patches). The change to t/t4051-diff-function-context.sh is needed because the heuristic shifts the changed hunk in the patch. To get the same result regardless of the heuristic configuration, we modify the test file differently: We insert a completely new line after line 2, instead of simply duplicating it. Helped-by: Jeff King <peff@peff.net> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Marc Branchaud <marcnarc@xiplink.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4051-diff-function-context.sh')
-rwxr-xr-xt/t4051-diff-function-context.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/t4051-diff-function-context.sh b/t/t4051-diff-function-context.sh
index 6154acb..3e6b485 100755
--- a/t/t4051-diff-function-context.sh
+++ b/t/t4051-diff-function-context.sh
@@ -72,7 +72,8 @@ test_expect_success 'setup' '
# overlap function context of 1st change and -u context of 2nd change
grep -v "delete me from hello" <"$dir/hello.c" >file.c &&
- sed 2p <"$dir/dummy.c" >>file.c &&
+ sed "2a\\
+ extra line" <"$dir/dummy.c" >>file.c &&
commit_and_tag changed_hello_dummy file.c &&
git checkout initial &&