X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft1300-repo-config.sh;h=42eac2a7cb0c8404b09a669c9526606eb89ab80e;hb=f85fd3f0d1213a2b714fddc7a834817aceeca932;hp=187ca2df5c81245256630428d3fc47567e0b4112;hpb=4b7f59af2a5b072a0a3950c956842e4d6223a167;p=git.git diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 187ca2df5..42eac2a7c 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -325,6 +325,9 @@ EOF test_expect_success 'new variable inserts into proper section' 'cmp .git/config expect' +test_expect_success 'alternative GIT_CONFIG (non-existing file should fail)' \ + 'git config --file non-existing-config -l; test $? != 0' + cat > other-config << EOF [ein] bahn = strasse @@ -338,6 +341,9 @@ GIT_CONFIG=other-config git config -l > output test_expect_success 'alternative GIT_CONFIG' 'cmp output expect' +test_expect_success 'alternative GIT_CONFIG (--file)' \ + 'git config --file other-config -l > output && cmp output expect' + GIT_CONFIG=other-config git config anwohner.park ausweis cat > expect << EOF @@ -442,6 +448,23 @@ test_expect_success numbers ' test z1048576 = "z$m" ' +cat > expect <actual + then + echo config should have failed + false + fi && + cmp actual expect +' + cat > expect << EOF true false @@ -585,12 +608,12 @@ Qsection.sub=section.val4 Qsection.sub=section.val5Q EOF -git config --null --list | tr '[\000]' 'Q' > result +git config --null --list | tr '\000' 'Q' > result echo >>result test_expect_success '--null --list' 'cmp result expect' -git config --null --get-regexp 'val[0-9]' | tr '[\000]' 'Q' > result +git config --null --get-regexp 'val[0-9]' | tr '\000' 'Q' > result echo >>result test_expect_success '--null --get-regexp' 'cmp result expect'