mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
fix(transport): get oid_type on local transport
Cache `oid_type` in `transport_local` struct during `connect()` so `git_remote_oid_type()` keeps working after disconnect. This matches the smart transport behavior.
This commit is contained in:
@@ -481,13 +481,9 @@ void test_network_remote_local__sha256_oid_type(void)
|
||||
|
||||
git_remote_disconnect(remote);
|
||||
|
||||
/*
|
||||
* Uncomment to reproduce SIGSEGV: local_oid_type dereferences
|
||||
* t->repo->oid_type, but local_close already freed t->repo.
|
||||
*
|
||||
* cl_git_pass(git_remote_oid_type(&oid_type, remote));
|
||||
* cl_assert_equal_i(GIT_OID_SHA256, oid_type);
|
||||
*/
|
||||
/* oid_type remains available after disconnect */
|
||||
cl_git_pass(git_remote_oid_type(&oid_type, remote));
|
||||
cl_assert_equal_i(GIT_OID_SHA256, oid_type);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user