summaryrefslogtreecommitdiff
path: root/t/t7011-skip-worktree-reading.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-08-08 14:21:32 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-08-08 14:21:33 -0700
commit880b3fee51e9b5b0bb7c0361fd3bf2c5fedda5bf (patch)
tree8f8b8c40c0e6914a81d5ac2c3b3658389f06de10 /t/t7011-skip-worktree-reading.sh
parentMerge branch 'mh/blame-worktree' into maint (diff)
parentcache-tree: do not generate empty trees as a result of all i-t-a subentries (diff)
downloadtgif-880b3fee51e9b5b0bb7c0361fd3bf2c5fedda5bf.tar.xz
Merge branch 'nd/cache-tree-ita' into maint
"git add -N dir/file && git write-tree" produced an incorrect tree when there are other paths in the same directory that sorts after "file". * nd/cache-tree-ita: cache-tree: do not generate empty trees as a result of all i-t-a subentries cache-tree.c: fix i-t-a entry skipping directory updates sometimes test-lib.sh: introduce and use $EMPTY_BLOB test-lib.sh: introduce and use $EMPTY_TREE
Diffstat (limited to 't/t7011-skip-worktree-reading.sh')
-rwxr-xr-xt/t7011-skip-worktree-reading.sh12
1 files changed, 5 insertions, 7 deletions
diff --git a/t/t7011-skip-worktree-reading.sh b/t/t7011-skip-worktree-reading.sh
index 88d60c1ce2..84f41451ec 100755
--- a/t/t7011-skip-worktree-reading.sh
+++ b/t/t7011-skip-worktree-reading.sh
@@ -23,17 +23,15 @@ S sub/1
H sub/2
EOF
-NULL_SHA1=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
-
setup_absent() {
test -f 1 && rm 1
git update-index --remove 1 &&
- git update-index --add --cacheinfo 100644 $NULL_SHA1 1 &&
+ git update-index --add --cacheinfo 100644 $EMPTY_BLOB 1 &&
git update-index --skip-worktree 1
}
test_absent() {
- echo "100644 $NULL_SHA1 0 1" > expected &&
+ echo "100644 $EMPTY_BLOB 0 1" > expected &&
git ls-files --stage 1 > result &&
test_cmp expected result &&
test ! -f 1
@@ -42,12 +40,12 @@ test_absent() {
setup_dirty() {
git update-index --force-remove 1 &&
echo dirty > 1 &&
- git update-index --add --cacheinfo 100644 $NULL_SHA1 1 &&
+ git update-index --add --cacheinfo 100644 $EMPTY_BLOB 1 &&
git update-index --skip-worktree 1
}
test_dirty() {
- echo "100644 $NULL_SHA1 0 1" > expected &&
+ echo "100644 $EMPTY_BLOB 0 1" > expected &&
git ls-files --stage 1 > result &&
test_cmp expected result &&
echo dirty > expected
@@ -120,7 +118,7 @@ test_expect_success 'grep with skip-worktree file' '
test "$(git grep --no-ext-grep test)" = "1:test"
'
-echo ":000000 100644 $_z40 $NULL_SHA1 A 1" > expected
+echo ":000000 100644 $_z40 $EMPTY_BLOB A 1" > expected
test_expect_success 'diff-index does not examine skip-worktree absent entries' '
setup_absent &&
git diff-index HEAD -- 1 > result &&