X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft1300-repo-config.sh;h=9e74b1f1415822c758ccc81bd4f12dc15a16eaee;hb=b7380fa7a9adb52860eef7e8885fb8bc179beae1;hp=91cbd551d8b8031b91437238e281591268a0268f;hpb=8cc15acfb8845bd23f68c92a51b68d57a72a9fed;p=git.git diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 91cbd551d..9e74b1f14 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -398,6 +398,17 @@ 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' +test_expect_success 'refer config from subdirectory' ' + mkdir x && + ( + cd x && + echo strasse >expect + git config --get --file ../other-config ein.bahn >actual && + test_cmp expect actual + ) + +' + GIT_CONFIG=other-config git config anwohner.park ausweis cat > expect << EOF @@ -459,6 +470,28 @@ EOF test_expect_success "rename succeeded" "test_cmp expect .git/config" +cat >> .git/config << EOF +[branch "vier"] z = 1 +EOF + +test_expect_success "rename a section with a var on the same line" \ + 'git config --rename-section branch.vier branch.zwei' + +cat > expect << EOF +# Hallo + #Bello +[branch "zwei"] + x = 1 +[branch "zwei"] + y = 1 +[branch "drei"] +weird +[branch "zwei"] + z = 1 +EOF + +test_expect_success "rename succeeded" "test_cmp expect .git/config" + cat >> .git/config << EOF [branch "zwei"] a = 1 [branch "vier"] EOF