{"thread":{"id":"13082","subject":"[PATCH] Fix config key miscount in url.*.insteadOf","startedAt":"2008-04-12T19:32:00Z","lastAt":"2008-04-12T19:32:00Z","messageCount":1,"participants":["Daniel Barkalow"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"74226","messageId":"alpine.LNX.1.00.0804121530000.19665@iabervon.org","threadId":"13082","inReplyTo":null,"subject":"[PATCH] Fix config key miscount in url.*.insteadOf","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-04-12T19:32:00Z","receivedAt":"2008-04-12T19:32:00Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"Also tighten test to require it to be correct.\n\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\nAfter all of the changing the name of the config option, I left the wrong \ncount for the key length, causing it to eat the first character of the \nURL.\n\n remote.c              |    2 +-\n t/t5516-fetch-push.sh |    8 ++++----\n 2 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/remote.c b/remote.c\nindex 08af7f9..369dc33 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -315,7 +315,7 @@ static int handle_config(const char *key, const char *value)\n \t}\n \tif (!prefixcmp(key, \"url.\")) {\n \t\tstruct rewrite *rewrite;\n-\t\tname = key + 5;\n+\t\tname = key + 4;\n \t\tsubkey = strrchr(name, '.');\n \t\tif (!subkey)\n \t\t\treturn 0;\ndiff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\nindex 793ffc6..6d7e738 100755\n--- a/t/t5516-fetch-push.sh\n+++ b/t/t5516-fetch-push.sh\n@@ -103,9 +103,9 @@ test_expect_success 'fetch with wildcard' '\n test_expect_success 'fetch with insteadOf' '\n \tmk_empty &&\n \t(\n-\t\tTRASH=$(pwd) &&\n+\t\tTRASH=$(pwd)/ &&\n \t\tcd testrepo &&\n-\t\tgit config url./$TRASH/.insteadOf trash/\n+\t\tgit config url.$TRASH.insteadOf trash/\n \t\tgit config remote.up.url trash/. &&\n \t\tgit config remote.up.fetch \"refs/heads/*:refs/remotes/origin/*\" &&\n \t\tgit fetch up &&\n@@ -145,8 +145,8 @@ test_expect_success 'push with wildcard' '\n \n test_expect_success 'push with insteadOf' '\n \tmk_empty &&\n-\tTRASH=$(pwd) &&\n-\tgit config url./$TRASH/.insteadOf trash/ &&\n+\tTRASH=$(pwd)/ &&\n+\tgit config url.$TRASH.insteadOf trash/ &&\n \tgit push trash/testrepo refs/heads/master:refs/remotes/origin/master &&\n \t(\n \t\tcd testrepo &&\n-- \n1.5.4.3.610.gea6cd\n"}]}