Skip to content

Commit 60e3aba

Browse files
iabervongitster
authored andcommitted
Fix config key miscount in url.*.insteadOf
Also tighten test to require it to be correct. Signed-off-by: Daniel Barkalow <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d6d96f8 commit 60e3aba

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ static int handle_config(const char *key, const char *value)
315315
}
316316
if (!prefixcmp(key, "url.")) {
317317
struct rewrite *rewrite;
318-
name = key + 5;
318+
name = key + 4;
319319
subkey = strrchr(name, '.');
320320
if (!subkey)
321321
return 0;

t/t5516-fetch-push.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ test_expect_success 'fetch with wildcard' '
103103
test_expect_success 'fetch with insteadOf' '
104104
mk_empty &&
105105
(
106-
TRASH=$(pwd) &&
106+
TRASH=$(pwd)/ &&
107107
cd testrepo &&
108-
git config url./$TRASH/.insteadOf trash/
108+
git config url.$TRASH.insteadOf trash/
109109
git config remote.up.url trash/. &&
110110
git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
111111
git fetch up &&
@@ -145,8 +145,8 @@ test_expect_success 'push with wildcard' '
145145

146146
test_expect_success 'push with insteadOf' '
147147
mk_empty &&
148-
TRASH=$(pwd) &&
149-
git config url./$TRASH/.insteadOf trash/ &&
148+
TRASH=$(pwd)/ &&
149+
git config url.$TRASH.insteadOf trash/ &&
150150
git push trash/testrepo refs/heads/master:refs/remotes/origin/master &&
151151
(
152152
cd testrepo &&

0 commit comments

Comments
 (0)