summaryrefslogtreecommitdiff
path: root/t/t5001-archive-attr.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t5001-archive-attr.sh')
-rwxr-xr-xt/t5001-archive-attr.sh24
1 files changed, 22 insertions, 2 deletions
diff --git a/t/t5001-archive-attr.sh b/t/t5001-archive-attr.sh
index 712ae52..eaf959d 100755
--- a/t/t5001-archive-attr.sh
+++ b/t/t5001-archive-attr.sh
@@ -2,6 +2,8 @@
test_description='git archive attribute tests'
+TEST_CREATE_REPO_NO_TEMPLATE=1
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
SUBSTFORMAT='%H (%h)%n'
@@ -20,6 +22,7 @@ extract_tar_to_dir () {
test_expect_success 'setup' '
echo ignored >ignored &&
+ mkdir .git/info &&
echo ignored export-ignore >>.git/info/attributes &&
git add ignored &&
@@ -30,6 +33,13 @@ test_expect_success 'setup' '
echo ignored-by-tree.d export-ignore >>.gitattributes &&
git add ignored-by-tree ignored-by-tree.d .gitattributes &&
+ mkdir subdir &&
+ >subdir/included &&
+ >subdir/ignored-by-subtree &&
+ >subdir/ignored-by-tree &&
+ echo ignored-by-subtree export-ignore >subdir/.gitattributes &&
+ git add subdir &&
+
echo ignored by worktree >ignored-by-worktree &&
echo ignored-by-worktree export-ignore >.gitattributes &&
git add ignored-by-worktree &&
@@ -46,7 +56,8 @@ test_expect_success 'setup' '
git commit -m. &&
- git clone --bare . bare &&
+ git clone --template= --bare . bare &&
+ mkdir bare/info &&
cp .git/info/attributes bare/info/attributes
'
@@ -89,6 +100,15 @@ test_expect_exists archive-pathspec-wildcard/ignored-by-worktree
test_expect_missing archive-pathspec-wildcard/excluded-by-pathspec.d
test_expect_missing archive-pathspec-wildcard/excluded-by-pathspec.d/file
+test_expect_success 'git -C subdir archive' '
+ git -C subdir archive HEAD >archive-subdir.tar &&
+ extract_tar_to_dir archive-subdir
+'
+
+test_expect_exists archive-subdir/included
+test_expect_missing archive-subdir/ignored-by-subtree
+test_expect_missing archive-subdir/ignored-by-tree
+
test_expect_success 'git archive with worktree attributes' '
git archive --worktree-attributes HEAD >worktree.tar &&
(mkdir worktree && cd worktree && "$TAR" xf -) <worktree.tar
@@ -118,7 +138,7 @@ test_expect_success 'git archive with worktree attributes, bare' '
'
test_expect_missing bare-worktree/ignored
-test_expect_exists bare-worktree/ignored-by-tree
+test_expect_missing bare-worktree/ignored-by-tree
test_expect_exists bare-worktree/ignored-by-worktree
test_expect_success 'export-subst' '