@matheusbsbs / matheus-bagliano / commits / 60e3aba9c3
Fork 0

Fix config key miscount in url.*.insteadOf

Also tighten test to require it to be correct. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Daniel Barkalow committed Apr 12, 2008 at 15:32 UTC 60e3aba9c3c99c40826c051d384e785935874962
2 files changed +5 -5
remote.c
+1 -1
@@ -315,7 +315,7 @@ static int handle_config(const char *key, const char *value)
315 }
316 if (!prefixcmp(key, "url.")) {
317 struct rewrite *rewrite;
318 - name = key + 5;
318 + name = key + 4;
319 subkey = strrchr(name, '.');
320 if (!subkey)
321 return 0;
t/t5516-fetch-push.sh
+4 -4
@@ -103,9 +103,9 @@ test_expect_success 'fetch with wildcard' '
103 test_expect_success 'fetch with insteadOf' '
104 mk_empty &&
105 (
106 - TRASH=$(pwd) &&
106 + TRASH=$(pwd)/ &&
107 cd testrepo &&
108 - git config url./$TRASH/.insteadOf trash/
108 + git config url.$TRASH.insteadOf trash/
109 git config remote.up.url trash/. &&
110 git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
111 git fetch up &&
@@ -145,8 +145,8 @@ test_expect_success 'push with wildcard' '
145
146 test_expect_success 'push with insteadOf' '
147 mk_empty &&
148 - TRASH=$(pwd) &&
149 - git config url./$TRASH/.insteadOf trash/ &&
148 + TRASH=$(pwd)/ &&
149 + git config url.$TRASH.insteadOf trash/ &&
150 git push trash/testrepo refs/heads/master:refs/remotes/origin/master &&
151 (
152 cd testrepo &&