mirror of
https://git.proxmox.com/git/libgit2
synced 2026-01-22 01:57:17 +00:00
Merge pull request #739 from arthurschreiber/fix_remote_connected
Fix git_remote_connected
This commit is contained in:
commit
8856849c1c
@ -417,6 +417,8 @@ static int git_close(git_transport *transport)
|
||||
return -1;
|
||||
}
|
||||
|
||||
t->parent.connected = 0;
|
||||
|
||||
#ifdef GIT_WIN32
|
||||
WSACleanup();
|
||||
#endif
|
||||
|
||||
@ -610,6 +610,8 @@ static int http_close(git_transport *transport)
|
||||
return -1;
|
||||
}
|
||||
|
||||
t->parent.connected = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -190,6 +190,7 @@ static int local_close(git_transport *transport)
|
||||
{
|
||||
transport_local *t = (transport_local *)transport;
|
||||
|
||||
t->parent.connected = 0;
|
||||
git_repository_free(t->repo);
|
||||
t->repo = NULL;
|
||||
|
||||
|
||||
@ -90,6 +90,15 @@ static void connect_to_local_repository(const char *local_repository)
|
||||
|
||||
}
|
||||
|
||||
void test_network_remotelocal__connected(void)
|
||||
{
|
||||
connect_to_local_repository(cl_fixture("testrepo.git"));
|
||||
cl_assert(git_remote_connected(remote));
|
||||
|
||||
git_remote_disconnect(remote);
|
||||
cl_assert(!git_remote_connected(remote));
|
||||
}
|
||||
|
||||
void test_network_remotelocal__retrieve_advertised_references(void)
|
||||
{
|
||||
int how_many_refs = 0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user