8000 URL parsing for google-compatible URLs by ethomson · Pull Request #6326 · libgit2/libgit2 · GitHub
[go: up one dir, main page]

Skip to content

URL parsing for google-compatible URLs #6326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
415 changes: 331 additions & 84 deletions src/util/net.c

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/util/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ typedef struct git_net_url {
char *port;
char *path;
char *query;
char *fragment;
char *username;
char *password;
} git_net_url;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

static git_net_url source, target;

void test_network_url_joinpath__initialize(void)
void test_url_joinpath__initialize(void)
{
memset(&source, 0, sizeof(source));
memset(&target, 0, sizeof(target));
}

void test_network_url_joinpath__cleanup(void)
void test_url_joinpath__cleanup(void)
{
git_net_url_dispose(&source);
git_net_url_dispose(&target);
}

void test_network_url_joinpath__target_paths_and_queries(void)
void test_url_joinpath__target_paths_and_queries(void)
{
cl_git_pass(git_net_url_parse(&source, "http://example.com/a/b"));

Expand All @@ -31,7 +31,7 @@ void test_network_url_joinpath__target_paths_and_queries(void)
git_net_url_dispose(&target);
}

void test_network_url_joinpath__source_query_removed(void)
void test_url_joinpath__source_query_removed(void)
{
cl_git_pass(git_net_url_parse(&source, "http://example.com/a/b?query&one&two"));

Expand All @@ -46,7 +46,7 @@ void test_network_url_joinpath__source_query_removed(void)
git_net_url_dispose(&target);
}

void test_network_url_joinpath__source_lacks_path(void)
void test_url_joinpath__source_lacks_path(void)
{
cl_git_pass(git_net_url_parse(&source, "http://example.com"));

Expand Down Expand Up @@ -91,7 +91,7 @@ void test_network_url_joinpath__source_lacks_path(void)
git_net_url_dispose(&target);
}

void test_network_url_joinpath__source_is_slash(void)
void test_url_joinpath__source_is_slash(void)
{
cl_git_pass(git_net_url_parse(&source, "http://example.com/"));

Expand Down Expand Up @@ -137,7 +137,7 @@ void test_network_url_joinpath__source_is_slash(void)
}


void test_network_url_joinpath__source_has_query(void)
void test_url_joinpath__source_has_query(void)
{
cl_git_pass(git_net_url_parse(&source, "http://example.com?query"));

Expand Down Expand Up @@ -183,7 +183,7 @@ void test_network_url_joinpath__source_has_query(void)
}


void test_network_url_joinpath__empty_query_ignored(void)
void test_url_joinpath__empty_query_ignored(void)
{
cl_git_pass(git_net_url_parse(&source, "http://example.com/foo"));

Expand Down
Loading
0