summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-07-06 22:09:17 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-07-06 22:09:17 -0700
commit0ac0947b1470b2157fd4c085a1fd0b207d94b40b (patch)
tree51c2bb419ef22e3ac3309ebe6523e422e403b90c /t
parentMerge branch 'js/default-branch-name' (diff)
parentdifftool -d: ensure that intent-to-add files are handled correctly (diff)
downloadtgif-0ac0947b1470b2157fd4c085a1fd0b207d94b40b.tar.xz
Merge branch 'js/diff-files-i-t-a-fix-for-difftool'
"git difftool" has trouble dealing with paths added to the index with the intent-to-add bit. * js/diff-files-i-t-a-fix-for-difftool: difftool -d: ensure that intent-to-add files are handled correctly diff-files --raw: show correct post-image of intent-to-add files
Diffstat (limited to 't')
-rwxr-xr-xt/t2203-add-intent.sh5
-rwxr-xr-xt/t7800-difftool.sh8
2 files changed, 10 insertions, 3 deletions
diff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh
index 8a5d55054f..cf0175ad6e 100755
--- a/t/t2203-add-intent.sh
+++ b/t/t2203-add-intent.sh
@@ -240,7 +240,6 @@ test_expect_success 'i-t-a files shown as new for "diff", "diff-files"; not-new
hash_e=$(git hash-object empty) &&
hash_n=$(git hash-object not-empty) &&
- hash_t=$(git hash-object -t tree /dev/null) &&
cat >expect.diff_p <<-EOF &&
diff --git a/empty b/empty
@@ -259,8 +258,8 @@ test_expect_success 'i-t-a files shown as new for "diff", "diff-files"; not-new
create mode 100644 not-empty
EOF
cat >expect.diff_a <<-EOF &&
- :000000 100644 0000000 $(git rev-parse --short $hash_t) A$(printf "\t")empty
- :000000 100644 0000000 $(git rev-parse --short $hash_t) A$(printf "\t")not-empty
+ :000000 100644 0000000 0000000 A$(printf "\t")empty
+ :000000 100644 0000000 0000000 A$(printf "\t")not-empty
EOF
git add -N empty not-empty &&
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 29b92907e2..524f30f7dc 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -720,6 +720,14 @@ test_expect_success SYMLINKS 'difftool --dir-diff handles modified symlinks' '
test_cmp expect actual
'
+test_expect_success 'add -N and difftool -d' '
+ test_when_finished git reset --hard &&
+
+ test_write_lines A B C >intent-to-add &&
+ git add -N intent-to-add &&
+ git difftool --dir-diff --extcmd ls
+'
+
test_expect_success 'outside worktree' '
echo 1 >1 &&
echo 2 >2 &&