diff options
author | Jonas Fonseca <fonseca@diku.dk> | 2008-04-13 13:56:54 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-04-19 03:31:27 +0400 |
commit | 24b6177e0261efba063c0b83ae0cdc5993945da9 (patch) | |
tree | 668917044c4bb47748f7a39339313591c8487bb0 /t/t5505-remote.sh | |
parent | d0ab520a2599afdfd4d61894863984fc36842b12 (diff) |
git-remote: reject adding remotes with invalid names
This can happen if the arguments to git-remote add is switched by the
user, and git would only show an error if fetching was also requested.
Fix it by using the refspec parsing engine to check if the requested
name can be parsed as a remote before add it.
Also cleanup so that the "remote.<name>.url" config name buffer is only
initialized once.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5505-remote.sh')
-rwxr-xr-x | t/t5505-remote.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index 0a7fea865d..af2d077792 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -253,4 +253,10 @@ test_expect_success '"remote show" does not show symbolic refs' ' ' +test_expect_success 'reject adding remote with an invalid name' ' + + ! git remote add some:url desired-name + +' + test_done |