Skip to content

Commit

Permalink
Fix config key miscount in url.*.insteadOf
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Barkalow authored and Junio C Hamano committed Apr 12, 2008
1 parent d6d96f8 commit 60e3aba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ static int handle_config(const char *key, const char *value)
}
if (!prefixcmp(key, "url.")) {
struct rewrite *rewrite;
name = key + 5;
name = key + 4;
subkey = strrchr(name, '.');
if (!subkey)
return 0;
Expand Down
8 changes: 4 additions & 4 deletions t/t5516-fetch-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ test_expect_success 'fetch with wildcard' '
test_expect_success 'fetch with insteadOf' '
mk_empty &&
(
TRASH=$(pwd) &&
TRASH=$(pwd)/ &&
cd testrepo &&
git config url./$TRASH/.insteadOf trash/
git config url.$TRASH.insteadOf trash/
git config remote.up.url trash/. &&
git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
git fetch up &&
Expand Down Expand Up @@ -145,8 +145,8 @@ test_expect_success 'push with wildcard' '

test_expect_success 'push with insteadOf' '
mk_empty &&
TRASH=$(pwd) &&
git config url./$TRASH/.insteadOf trash/ &&
TRASH=$(pwd)/ &&
git config url.$TRASH.insteadOf trash/ &&
git push trash/testrepo refs/heads/master:refs/remotes/origin/master &&
(
cd testrepo &&
Expand Down

0 comments on commit 60e3aba

Please sign in to comment.