Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-08-26 22:16:26 +0400
committerJunio C Hamano <gitster@pobox.com>2014-08-26 22:16:26 +0400
commit4109c28e055dba27d73cefb956bea5e611f66ec0 (patch)
tree8b323ced930a0eb5bb7912059506278f88ec36a9 /t
parenta3d54f9a1fa481727a849b8753fc9d1abafe6583 (diff)
parente09867f0605702c2d4e65b99e178cdaa215a7370 (diff)
Merge branch 'jk/diff-tree-t-fix'
Fix (rarely used) "git diff-tree -t" regression in 2.0. * jk/diff-tree-t-fix: intersect_paths: respect mode in git's tree-sort
Diffstat (limited to 't')
-rwxr-xr-xt/t4038-diff-combined.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh
index 41913c3aa3..0b4f7dfdc6 100755
--- a/t/t4038-diff-combined.sh
+++ b/t/t4038-diff-combined.sh
@@ -401,4 +401,38 @@ test_expect_success 'combine diff missing delete bug' '
compare_diff_patch expected actual
'
+test_expect_success 'combine diff gets tree sorting right' '
+ # create a directory and a file that sort differently in trees
+ # versus byte-wise (implied "/" sorts after ".")
+ git checkout -f master &&
+ mkdir foo &&
+ echo base >foo/one &&
+ echo base >foo/two &&
+ echo base >foo.ext &&
+ git add foo foo.ext &&
+ git commit -m base &&
+
+ # one side modifies a file in the directory, along with the root
+ # file...
+ echo master >foo/one &&
+ echo master >foo.ext &&
+ git commit -a -m master &&
+
+ # the other side modifies the other file in the directory
+ git checkout -b other HEAD^ &&
+ echo other >foo/two &&
+ git commit -a -m other &&
+
+ # And now we merge. The files in the subdirectory will resolve cleanly,
+ # meaning that a combined diff will not find them interesting. But it
+ # will find the tree itself interesting, because it had to be merged.
+ git checkout master &&
+ git merge other &&
+
+ printf "MM\tfoo\n" >expect &&
+ git diff-tree -c --name-status -t HEAD >actual.tmp &&
+ sed 1d <actual.tmp >actual &&
+ test_cmp expect actual
+'
+
test_done