1#!/bin/sh23test_description='git archive attribute pattern tests'45. ./test-lib.sh67test_expect_exists() {8test_expect_success " $1 exists" "test -e $1"9}1011test_expect_missing() {12test_expect_success " $1 does not exist" "test ! -e $1"13}1415test_expect_success 'setup' '16echo ignored >ignored &&17echo ignored export-ignore >>.git/info/attributes &&18git add ignored &&1920mkdir not-ignored-dir &&21echo ignored-in-tree >not-ignored-dir/ignored &&22echo not-ignored-in-tree >not-ignored-dir/ignored-only-if-dir &&23git add not-ignored-dir &&2425mkdir ignored-only-if-dir &&26echo ignored by ignored dir >ignored-only-if-dir/ignored-by-ignored-dir &&27echo ignored-only-if-dir/ export-ignore >>.git/info/attributes &&28git add ignored-only-if-dir &&293031mkdir -p one-level-lower/two-levels-lower/ignored-only-if-dir &&32echo ignored by ignored dir >one-level-lower/two-levels-lower/ignored-only-if-dir/ignored-by-ignored-dir &&33git add one-level-lower &&3435git commit -m. &&3637git clone --bare . bare &&38cp .git/info/attributes bare/info/attributes39'4041test_expect_success 'git archive' '42git archive HEAD >archive.tar &&43(mkdir archive && cd archive && "$TAR" xf -) <archive.tar44'4546test_expect_missing archive/ignored47test_expect_missing archive/not-ignored-dir/ignored48test_expect_exists archive/not-ignored-dir/ignored-only-if-dir49test_expect_exists archive/not-ignored-dir/50test_expect_missing archive/ignored-only-if-dir/51test_expect_missing archive/ignored-ony-if-dir/ignored-by-ignored-dir52test_expect_exists archive/one-level-lower/53test_expect_missing archive/one-level-lower/two-levels-lower/ignored-only-if-dir/54test_expect_missing archive/one-level-lower/two-levels-lower/ignored-ony-if-dir/ignored-by-ignored-dir555657test_done