@@ -346,17 +346,14 @@ test_expect_success 'setup bare' '
346346
347347test_expect_success ' bare repository: check that .gitattribute is ignored' '
348348 (
349- cd bare.git &&
350- (
351- echo "f test=f" &&
352- echo "a/i test=a/i"
353- ) >.gitattributes &&
354- attr_check f unspecified &&
355- attr_check a/f unspecified &&
356- attr_check a/c/f unspecified &&
357- attr_check a/i unspecified &&
358- attr_check subdir/a/i unspecified
359- )
349+ echo "f test=f" &&
350+ echo "a/i test=a/i"
351+ ) >bare.git/.gitattributes &&
352+ attr_check f unspecified --git-dir=bare.git &&
353+ attr_check a/f unspecified --git-dir=bare.git &&
354+ attr_check a/c/f unspecified --git-dir=bare.git &&
355+ attr_check a/i unspecified --git-dir=bare.git &&
356+ attr_check subdir/a/i unspecified --git-dir=bare.git
360357'
361358
362359bad_attr_source_err=" fatal: bad --attr-source or GIT_ATTR_SOURCE"
@@ -449,41 +446,32 @@ test_expect_success 'diff without repository with attr source' '
449446'
450447
451448test_expect_success ' bare repository: with --source' '
452- (
453- cd bare.git &&
454- attr_check_source foo/bar/f f tag-1 &&
455- attr_check_source foo/bar/a/i n tag-1 &&
456- attr_check_source foo/bar/f unspecified tag-2 &&
457- attr_check_source foo/bar/a/i m tag-2 &&
458- attr_check_source foo/bar/g g tag-2 &&
459- attr_check_source foo/bar/g unspecified tag-1
460- )
449+ attr_check_source foo/bar/f f tag-1 --git-dir=bare.git &&
450+ attr_check_source foo/bar/a/i n tag-1 --git-dir=bare.git &&
451+ attr_check_source foo/bar/f unspecified tag-2 --git-dir=bare.git &&
452+ attr_check_source foo/bar/a/i m tag-2 --git-dir=bare.git &&
453+ attr_check_source foo/bar/g g tag-2 --git-dir=bare.git &&
454+ attr_check_source foo/bar/g unspecified tag-1 --git-dir=bare.git
461455'
462456
463457test_expect_success ' bare repository: check that --cached honors index' '
464- (
465- cd bare.git &&
466- GIT_INDEX_FILE=../.git/index \
467- git check-attr --cached --stdin --all <../stdin-all |
468- sort >actual &&
469- test_cmp ../specified-all actual
470- )
458+ GIT_INDEX_FILE=.git/index \
459+ git --git-dir=bare.git check-attr --cached --stdin --all <stdin-all |
460+ sort >actual &&
461+ test_cmp specified-all actual
471462'
472463
473464test_expect_success ' bare repository: test info/attributes' '
465+ mkdir -p bare.git/info &&
474466 (
475- cd bare.git &&
476- mkdir info &&
477- (
478- echo "f test=f" &&
479- echo "a/i test=a/i"
480- ) >info/attributes &&
481- attr_check f f &&
482- attr_check a/f f &&
483- attr_check a/c/f f &&
484- attr_check a/i a/i &&
485- attr_check subdir/a/i unspecified
486- )
467+ echo "f test=f" &&
468+ echo "a/i test=a/i"
469+ ) >bare.git/info/attributes &&
470+ attr_check f f --git-dir=bare.git &&
471+ attr_check a/f f --git-dir=bare.git &&
472+ attr_check a/c/f f --git-dir=bare.git &&
473+ attr_check a/i a/i --git-dir=bare.git &&
474+ attr_check subdir/a/i unspecified --git-dir=bare.git
487475'
488476
489477test_expect_success ' binary macro expanded by -a' '
0 commit comments