Skip to content

Commit 6b12762

Browse files
committed
online: test with https instead of git protocol
GitHub is removing support for the unauthenticated git protocol; test with the https protocol.
1 parent 37caa8d commit 6b12762

File tree

5 files changed

+43
-52
lines changed

5 files changed

+43
-52
lines changed

tests/fetchhead/fetchhead_data.h

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
11

22
#define FETCH_HEAD_WILDCARD_DATA_LOCAL \
3-
"49322bb17d3acc9146f98c97d078513228bbf3c0\t\tbranch 'master' of git://github.com/libgit2/TestGitRepository\n" \
4-
"0966a434eb1a025db6b71485ab63a3bfbea520b6\tnot-for-merge\tbranch 'first-merge' of git://github.com/libgit2/TestGitRepository\n" \
5-
"42e4e7c5e507e113ebbb7801b16b52cf867b7ce1\tnot-for-merge\tbranch 'no-parent' of git://github.com/libgit2/TestGitRepository\n" \
6-
"d96c4e80345534eccee5ac7b07fc7603b56124cb\tnot-for-merge\ttag 'annotated_tag' of git://github.com/libgit2/TestGitRepository\n" \
7-
"55a1a760df4b86a02094a904dfa511deb5655905\tnot-for-merge\ttag 'blob' of git://github.com/libgit2/TestGitRepository\n" \
8-
"8f50ba15d49353813cc6e20298002c0d17b0a9ee\tnot-for-merge\ttag 'commit_tree' of git://github.com/libgit2/TestGitRepository\n"
3+
"49322bb17d3acc9146f98c97d078513228bbf3c0\t\tbranch 'master' of https://github.com/libgit2/TestGitRepository\n" \
4+
"0966a434eb1a025db6b71485ab63a3bfbea520b6\tnot-for-merge\tbranch 'first-merge' of https://github.com/libgit2/TestGitRepository\n" \
5+
"42e4e7c5e507e113ebbb7801b16b52cf867b7ce1\tnot-for-merge\tbranch 'no-parent' of https://github.com/libgit2/TestGitRepository\n" \
6+
"d96c4e80345534eccee5ac7b07fc7603b56124cb\tnot-for-merge\ttag 'annotated_tag' of https://github.com/libgit2/TestGitRepository\n" \
7+
"55a1a760df4b86a02094a904dfa511deb5655905\tnot-for-merge\ttag 'blob' of https://github.com/libgit2/TestGitRepository\n" \
8+
"8f50ba15d49353813cc6e20298002c0d17b0a9ee\tnot-for-merge\ttag 'commit_tree' of https://github.com/libgit2/TestGitRepository\n"
99

1010
#define FETCH_HEAD_WILDCARD_DATA \
11-
"49322bb17d3acc9146f98c97d078513228bbf3c0\t\tbranch 'master' of git://github.com/libgit2/TestGitRepository\n" \
12-
"0966a434eb1a025db6b71485ab63a3bfbea520b6\tnot-for-merge\tbranch 'first-merge' of git://github.com/libgit2/TestGitRepository\n" \
13-
"42e4e7c5e507e113ebbb7801b16b52cf867b7ce1\tnot-for-merge\tbranch 'no-parent' of git://github.com/libgit2/TestGitRepository\n" \
14-
"d96c4e80345534eccee5ac7b07fc7603b56124cb\tnot-for-merge\ttag 'annotated_tag' of git://github.com/libgit2/TestGitRepository\n" \
15-
"55a1a760df4b86a02094a904dfa511deb5655905\tnot-for-merge\ttag 'blob' of git://github.com/libgit2/TestGitRepository\n" \
16-
"8f50ba15d49353813cc6e20298002c0d17b0a9ee\tnot-for-merge\ttag 'commit_tree' of git://github.com/libgit2/TestGitRepository\n" \
17-
"6e0c7bdb9b4ed93212491ee778ca1c65047cab4e\tnot-for-merge\ttag 'nearly-dangling' of git://github.com/libgit2/TestGitRepository\n"
11+
"49322bb17d3acc9146f98c97d078513228bbf3c0\t\tbranch 'master' of https://github.com/libgit2/TestGitRepository\n" \
12+
"0966a434eb1a025db6b71485ab63a3bfbea520b6\tnot-for-merge\tbranch 'first-merge' of https://github.com/libgit2/TestGitRepository\n" \
13+
"42e4e7c5e507e113ebbb7801b16b52cf867b7ce1\tnot-for-merge\tbranch 'no-parent' of https://github.com/libgit2/TestGitRepository\n" \
14+
"d96c4e80345534eccee5ac7b07fc7603b56124cb\tnot-for-merge\ttag 'annotated_tag' of https://github.com/libgit2/TestGitRepository\n" \
15+
"55a1a760df4b86a02094a904dfa511deb5655905\tnot-for-merge\ttag 'blob' of https://github.com/libgit2/TestGitRepository\n" \
16+
"8f50ba15d49353813cc6e20298002c0d17b0a9ee\tnot-for-merge\ttag 'commit_tree' of https://github.com/libgit2/TestGitRepository\n" \
17+
"6e0c7bdb9b4ed93212491ee778ca1c65047cab4e\tnot-for-merge\ttag 'nearly-dangling' of https://github.com/libgit2/TestGitRepository\n"
1818

1919
#define FETCH_HEAD_WILDCARD_DATA2 \
20-
"49322bb17d3acc9146f98c97d078513228bbf3c0\t\tbranch 'master' of git://github.com/libgit2/TestGitRepository\n" \
21-
"0966a434eb1a025db6b71485ab63a3bfbea520b6\tnot-for-merge\tbranch 'first-merge' of git://github.com/libgit2/TestGitRepository\n" \
22-
"42e4e7c5e507e113ebbb7801b16b52cf867b7ce1\tnot-for-merge\tbranch 'no-parent' of git://github.com/libgit2/TestGitRepository\n" \
20+
"49322bb17d3acc9146f98c97d078513228bbf3c0\t\tbranch 'master' of https://github.com/libgit2/TestGitRepository\n" \
21+
"0966a434eb1a025db6b71485ab63a3bfbea520b6\tnot-for-merge\tbranch 'first-merge' of https://github.com/libgit2/TestGitRepository\n" \
22+
"42e4e7c5e507e113ebbb7801b16b52cf867b7ce1\tnot-for-merge\tbranch 'no-parent' of https://github.com/libgit2/TestGitRepository\n" \
2323

2424
#define FETCH_HEAD_NO_MERGE_DATA \
25-
"0966a434eb1a025db6b71485ab63a3bfbea520b6\tnot-for-merge\tbranch 'first-merge' of git://github.com/libgit2/TestGitRepository\n" \
26-
"49322bb17d3acc9146f98c97d078513228bbf3c0\tnot-for-merge\tbranch 'master' of git://github.com/libgit2/TestGitRepository\n" \
27-
"42e4e7c5e507e113ebbb7801b16b52cf867b7ce1\tnot-for-merge\tbranch 'no-parent' of git://github.com/libgit2/TestGitRepository\n" \
28-
"d96c4e80345534eccee5ac7b07fc7603b56124cb\tnot-for-merge\ttag 'annotated_tag' of git://github.com/libgit2/TestGitRepository\n" \
29-
"55a1a760df4b86a02094a904dfa511deb5655905\tnot-for-merge\ttag 'blob' of git://github.com/libgit2/TestGitRepository\n" \
30-
"8f50ba15d49353813cc6e20298002c0d17b0a9ee\tnot-for-merge\ttag 'commit_tree' of git://github.com/libgit2/TestGitRepository\n" \
31-
"6e0c7bdb9b4ed93212491ee778ca1c65047cab4e\tnot-for-merge\ttag 'nearly-dangling' of git://github.com/libgit2/TestGitRepository\n"
25+
"0966a434eb1a025db6b71485ab63a3bfbea520b6\tnot-for-merge\tbranch 'first-merge' of https://github.com/libgit2/TestGitRepository\n" \
26+
"49322bb17d3acc9146f98c97d078513228bbf3c0\tnot-for-merge\tbranch 'master' of https://github.com/libgit2/TestGitRepository\n" \
27+
"42e4e7c5e507e113ebbb7801b16b52cf867b7ce1\tnot-for-merge\tbranch 'no-parent' of https://github.com/libgit2/TestGitRepository\n" \
28+
"d96c4e80345534eccee5ac7b07fc7603b56124cb\tnot-for-merge\ttag 'annotated_tag' of https://github.com/libgit2/TestGitRepository\n" \
29+
"55a1a760df4b86a02094a904dfa511deb5655905\tnot-for-merge\ttag 'blob' of https://github.com/libgit2/TestGitRepository\n" \
30+
"8f50ba15d49353813cc6e20298002c0d17b0a9ee\tnot-for-merge\ttag 'commit_tree' of https://github.com/libgit2/TestGitRepository\n" \
31+
"6e0c7bdb9b4ed93212491ee778ca1c65047cab4e\tnot-for-merge\ttag 'nearly-dangling' of https://github.com/libgit2/TestGitRepository\n"
3232

3333
#define FETCH_HEAD_NO_MERGE_DATA2 \
34-
"0966a434eb1a025db6b71485ab63a3bfbea520b6\tnot-for-merge\tbranch 'first-merge' of git://github.com/libgit2/TestGitRepository\n" \
35-
"49322bb17d3acc9146f98c97d078513228bbf3c0\tnot-for-merge\tbranch 'master' of git://github.com/libgit2/TestGitRepository\n" \
36-
"42e4e7c5e507e113ebbb7801b16b52cf867b7ce1\tnot-for-merge\tbranch 'no-parent' of git://github.com/libgit2/TestGitRepository\n" \
34+
"0966a434eb1a025db6b71485ab63a3bfbea520b6\tnot-for-merge\tbranch 'first-merge' of https://github.com/libgit2/TestGitRepository\n" \
35+
"49322bb17d3acc9146f98c97d078513228bbf3c0\tnot-for-merge\tbranch 'master' of https://github.com/libgit2/TestGitRepository\n" \
36+
"42e4e7c5e507e113ebbb7801b16b52cf867b7ce1\tnot-for-merge\tbranch 'no-parent' of https://github.com/libgit2/TestGitRepository\n" \
3737

3838
#define FETCH_HEAD_NO_MERGE_DATA3 \
39-
"0966a434eb1a025db6b71485ab63a3bfbea520b6\tnot-for-merge\tbranch 'first-merge' of git://github.com/libgit2/TestGitRepository\n" \
40-
"49322bb17d3acc9146f98c97d078513228bbf3c0\tnot-for-merge\tbranch 'master' of git://github.com/libgit2/TestGitRepository\n" \
41-
"42e4e7c5e507e113ebbb7801b16b52cf867b7ce1\tnot-for-merge\tbranch 'no-parent' of git://github.com/libgit2/TestGitRepository\n" \
42-
"8f50ba15d49353813cc6e20298002c0d17b0a9ee\tnot-for-merge\ttag 'commit_tree' of git://github.com/libgit2/TestGitRepository\n" \
39+
"0966a434eb1a025db6b71485ab63a3bfbea520b6\tnot-for-merge\tbranch 'first-merge' of https://github.com/libgit2/TestGitRepository\n" \
40+
"49322bb17d3acc9146f98c97d078513228bbf3c0\tnot-for-merge\tbranch 'master' of https://github.com/libgit2/TestGitRepository\n" \
41+
"42e4e7c5e507e113ebbb7801b16b52cf867b7ce1\tnot-for-merge\tbranch 'no-parent' of https://github.com/libgit2/TestGitRepository\n" \
42+
"8f50ba15d49353813cc6e20298002c0d17b0a9ee\tnot-for-merge\ttag 'commit_tree' of https://github.com/libgit2/TestGitRepository\n" \
4343

4444
#define FETCH_HEAD_EXPLICIT_DATA \
45-
"0966a434eb1a025db6b71485ab63a3bfbea520b6\t\tbranch 'first-merge' of git://github.com/libgit2/TestGitRepository\n"
45+
"0966a434eb1a025db6b71485ab63a3bfbea520b6\t\tbranch 'first-merge' of https://github.com/libgit2/TestGitRepository\n"
4646

4747
#define FETCH_HEAD_QUOTE_DATA \
48-
"0966a434eb1a025db6b71485ab63a3bfbea520b6\t\tbranch 'first's-merge' of git://github.com/libgit2/TestGitRepository\n"
48+
"0966a434eb1a025db6b71485ab63a3bfbea520b6\t\tbranch 'first's-merge' of https://github.com/libgit2/TestGitRepository\n"

tests/fetchhead/nonetwork.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,42 +33,42 @@ static void populate_fetchhead(git_vector *out, git_repository *repo)
3333
"49322bb17d3acc9146f98c97d078513228bbf3c0"));
3434
cl_git_pass(git_fetchhead_ref_create(&fetchhead_ref, &oid, 1,
3535
"refs/heads/master",
36-
"git://github.com/libgit2/TestGitRepository"));
36+
"https://github.com/libgit2/TestGitRepository"));
3737
cl_git_pass(git_vector_insert(out, fetchhead_ref));
3838

3939
cl_git_pass(git_oid_fromstr(&oid,
4040
"0966a434eb1a025db6b71485ab63a3bfbea520b6"));
4141
cl_git_pass(git_fetchhead_ref_create(&fetchhead_ref, &oid, 0,
4242
"refs/heads/first-merge",
43-
"git://github.com/libgit2/TestGitRepository"));
43+
"https://github.com/libgit2/TestGitRepository"));
4444
cl_git_pass(git_vector_insert(out, fetchhead_ref));
4545

4646
cl_git_pass(git_oid_fromstr(&oid,
4747
"42e4e7c5e507e113ebbb7801b16b52cf867b7ce1"));
4848
cl_git_pass(git_fetchhead_ref_create(&fetchhead_ref, &oid, 0,
4949
"refs/heads/no-parent",
50-
"git://github.com/libgit2/TestGitRepository"));
50+
"https://github.com/libgit2/TestGitRepository"));
5151
cl_git_pass(git_vector_insert(out, fetchhead_ref));
5252

5353
cl_git_pass(git_oid_fromstr(&oid,
5454
"d96c4e80345534eccee5ac7b07fc7603b56124cb"));
5555
cl_git_pass(git_fetchhead_ref_create(&fetchhead_ref, &oid, 0,
5656
"refs/tags/annotated_tag",
57-
"git://github.com/libgit2/TestGitRepository"));
57+
"https://github.com/libgit2/TestGitRepository"));
5858
cl_git_pass(git_vector_insert(out, fetchhead_ref));
5959

6060
cl_git_pass(git_oid_fromstr(&oid,
6161
"55a1a760df4b86a02094a904dfa511deb5655905"));
6262
cl_git_pass(git_fetchhead_ref_create(&fetchhead_ref, &oid, 0,
6363
"refs/tags/blob",
64-
"git://github.com/libgit2/TestGitRepository"));
64+
"https://github.com/libgit2/TestGitRepository"));
6565
cl_git_pass(git_vector_insert(out, fetchhead_ref));
6666

6767
cl_git_pass(git_oid_fromstr(&oid,
6868
"8f50ba15d49353813cc6e20298002c0d17b0a9ee"));
6969
cl_git_pass(git_fetchhead_ref_create(&fetchhead_ref, &oid, 0,
7070
"refs/tags/commit_tree",
71-
"git://github.com/libgit2/TestGitRepository"));
71+
"https://github.com/libgit2/TestGitRepository"));
7272
cl_git_pass(git_vector_insert(out, fetchhead_ref));
7373

7474
cl_git_pass(git_fetchhead_write(repo, out));

tests/online/fetch.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,6 @@ static void do_fetch(const char *url, git_remote_autotag_option_t flag, int n)
6767
git_remote_free(remote);
6868
}
6969

70-
void test_online_fetch__default_git(void)
71-
{
72-
do_fetch("git://github.com/libgit2/TestGitRepository.git", GIT_REMOTE_DOWNLOAD_TAGS_AUTO, 6);
73-
}
74-
7570
void test_online_fetch__default_http(void)
7671
{
7772
do_fetch("http://github.com/libgit2/TestGitRepository.git", GIT_REMOTE_DOWNLOAD_TAGS_AUTO, 6);
@@ -84,7 +79,7 @@ void test_online_fetch__default_https(void)
8479

8580
void test_online_fetch__no_tags_git(void)
8681
{
87-
do_fetch("git://github.com/libgit2/TestGitRepository.git", GIT_REMOTE_DOWNLOAD_TAGS_NONE, 3);
82+
do_fetch("https://github.com/libgit2/TestGitRepository.git", GIT_REMOTE_DOWNLOAD_TAGS_NONE, 3);
8883
}
8984

9085
void test_online_fetch__no_tags_http(void)
@@ -95,7 +90,7 @@ void test_online_fetch__no_tags_http(void)
9590
void test_online_fetch__fetch_twice(void)
9691
{
9792
git_remote *remote;
98-
cl_git_pass(git_remote_create(&remote, _repo, "test", "git://github.com/libgit2/TestGitRepository.git"));
93+
cl_git_pass(git_remote_create(&remote, _repo, "test", "https://github.com/libgit2/TestGitRepository.git"));
9994
cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL, NULL, NULL));
10095
cl_git_pass(git_remote_download(remote, NULL, NULL));
10196
git_remote_disconnect(remote);

tests/online/fetchhead.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "../fetchhead/fetchhead_data.h"
66
#include "git2/clone.h"
77

8-
#define LIVE_REPO_URL "git://github.com/libgit2/TestGitRepository"
8+
#define LIVE_REPO_URL "https://github.com/libgit2/TestGitRepository"
99

1010
static git_repository *g_repo;
1111
static git_clone_options g_options;
@@ -53,7 +53,6 @@ static void fetchhead_test_fetch(const char *fetchspec, const char *expected_fet
5353
git_remote *remote;
5454
git_fetch_options fetch_opts = GIT_FETCH_OPTIONS_INIT;
5555
git_buf fetchhead_buf = GIT_BUF_INIT;
56-
int equals = 0;
5756
git_strarray array, *active_refs = NULL;
5857

5958
cl_git_pass(git_remote_lookup(&remote, g_repo, "origin"));
@@ -70,11 +69,8 @@ static void fetchhead_test_fetch(const char *fetchspec, const char *expected_fet
7069

7170
cl_git_pass(git_futils_readbuffer(&fetchhead_buf, "./foo/.git/FETCH_HEAD"));
7271

73-
equals = (strcmp(fetchhead_buf.ptr, expected_fetchhead) == 0);
74-
72+
cl_assert_equal_s(fetchhead_buf.ptr, expected_fetchhead);
7573
git_buf_dispose(&fetchhead_buf);
76-
77-
cl_assert(equals);
7874
}
7975

8076
void test_online_fetchhead__wildcard_spec(void)

tests/online/remotes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "clar_libgit2.h"
22

3-
#define URL "git://github.com/libgit2/TestGitRepository"
3+
#define URL "https://github.com/libgit2/TestGitRepository"
44
#define REFSPEC "refs/heads/first-merge:refs/remotes/origin/first-merge"
55

66
static int remote_single_branch(git_remote **out, git_repository *repo, const char *name, const char *url, void *payload)

0 commit comments

Comments
 (0)