Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 21361cb

Browse files
author
Vicent Marti
committed
Merge pull request libgit2#2719 from libgit2/cmn/fetch-twice
fetch: clear the connection data on close
2 parents d7674b5 + 1ca61bd commit 21361cb

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/transports/http.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,7 @@ static int http_close(git_smart_subtransport *subtransport)
10091009
git_vector_clear(&t->auth_contexts);
10101010

10111011
gitno_connection_data_free_ptrs(&t->connection_data);
1012+
memset(&t->connection_data, 0x0, sizeof(gitno_connection_data));
10121013

10131014
return 0;
10141015
}

tests/online/fetch.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,14 @@ void test_online_fetch__remote_symrefs(void)
202202

203203
git_remote_free(remote);
204204
}
205+
206+
void test_online_fetch__twice(void)
207+
{
208+
git_remote *remote;
209+
210+
cl_git_pass(git_remote_create(&remote, _repo, "test", "http://github.com/libgit2/TestGitRepository.git"));
211+
cl_git_pass(git_remote_fetch(remote, NULL, NULL, NULL));
212+
cl_git_pass(git_remote_fetch(remote, NULL, NULL, NULL));
213+
214+
git_remote_free(remote);
215+
}

0 commit comments

Comments
 (0)