X-Git-Url: https://git.tokkee.org/?p=git.git;a=blobdiff_plain;f=t%2Ft1300-repo-config.sh;h=5f249f681e9324d7d35e3aee4dc9a834beff6c75;hp=6de46bbd57a18e4fd7b3aee8df49abfa8fd4a9c1;hb=v1.7.9-8-g270a344;hpb=c9b5e2a57d2a69e0c6183758445da2f230b5a9f0 diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 6de46bbd5..5f249f681 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -458,6 +458,14 @@ test_expect_success 'refer config from subdirectory' ' ' +test_expect_success 'refer config from subdirectory via GIT_CONFIG' ' + ( + cd x && + GIT_CONFIG=../other-config git config --get ein.bahn >actual && + test_cmp expect actual + ) +' + cat > expect << EOF [ein] bahn = strasse @@ -960,4 +968,21 @@ test_expect_success 'git -c complains about empty key and value' ' test_must_fail git -c "" rev-parse ' +test_expect_success 'git config --edit works' ' + git config -f tmp test.value no && + echo test.value=yes >expect && + GIT_EDITOR="echo [test]value=yes >" git config -f tmp --edit && + git config -f tmp --list >actual && + test_cmp expect actual +' + +test_expect_success 'git config --edit respects core.editor' ' + git config -f tmp test.value no && + echo test.value=yes >expect && + test_config core.editor "echo [test]value=yes >" && + git config -f tmp --edit && + git config -f tmp --list >actual && + test_cmp expect actual +' + test_done