Skip to content

Commit 12832ba

Browse files
authored
Merge pull request libgit2#6326 from libgit2/ethomson/url_parse
URL parsing for google-compatible URLs
2 parents d0203b6 + 1ee9b1f commit 12832ba

File tree

8 files changed

+652
-174
lines changed

8 files changed

+652
-174
lines changed

src/util/net.c

Lines changed: 331 additions & 84 deletions
Large diffs are not rendered by default.

src/util/net.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ typedef struct git_net_url {
1515
char *port;
1616
char *path;
1717
char *query;
18+
char *fragment;
1819
char *username;
1920
char *password;
2021
} git_net_url;
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44

55
static git_net_url source, target;
66

7-
void test_network_url_joinpath__initialize(void)
7+
void test_url_joinpath__initialize(void)
88
{
99
memset(&source, 0, sizeof(source));
1010
memset(&target, 0, sizeof(target));
1111
}
1212

13-
void test_network_url_joinpath__cleanup(void)
13+
void test_url_joinpath__cleanup(void)
1414
{
1515
git_net_url_dispose(&source);
1616
git_net_url_dispose(&target);
1717
}
1818

19-
void test_network_url_joinpath__target_paths_and_queries(void)
19+
void test_url_joinpath__target_paths_and_queries(void)
2020
{
2121
cl_git_pass(git_net_url_parse(&source, "http://example.com/a/b"));
2222

@@ -31,7 +31,7 @@ void test_network_url_joinpath__target_paths_and_queries(void)
3131
git_net_url_dispose(&target);
3232
}
3333

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

@@ -46,7 +46,7 @@ void test_network_url_joinpath__source_query_removed(void)
4646
git_net_url_dispose(&target);
4747
}
4848

49-
void test_network_url_joinpath__source_lacks_path(void)
49+
void test_url_joinpath__source_lacks_path(void)
5050
{
5151
cl_git_pass(git_net_url_parse(&source, "http://example.com"));
5252

@@ -91,7 +91,7 @@ void test_network_url_joinpath__source_lacks_path(void)
9191
git_net_url_dispose(&target);
9292
}
9393

94-
void test_network_url_joinpath__source_is_slash(void)
94+
void test_url_joinpath__source_is_slash(void)
9595
{
9696
cl_git_pass(git_net_url_parse(&source, "http://example.com/"));
9797

@@ -137,7 +137,7 @@ void test_network_url_joinpath__source_is_slash(void)
137137
}
138138

139139

140-
void test_network_url_joinpath__source_has_query(void)
140+
void test_url_joinpath__source_has_query(void)
141141
{
142142
cl_git_pass(git_net_url_parse(&source, "http://example.com?query"));
143143

@@ -183,7 +183,7 @@ void test_network_url_joinpath__source_has_query(void)
183183
}
184184

185185

186-
void test_network_url_joinpath__empty_query_ignored(void)
186+
void test_url_joinpath__empty_query_ignored(void)
187187
{
188188
cl_git_pass(git_net_url_parse(&source, "http://example.com/foo"));
189189

0 commit comments

Comments
 (0)