fix(smart): keep caps across RPC stream resets

Preserve ref-advertised capabilities when only the stream is reset.

This prevents losing `object-format` before `git_remote_oid_type()`
and fixes SHA256 clone pack trailer mismatch.

Fixes libgit2/libgit2#7182
This commit is contained in:
Weihang Lo
2026-01-03 22:02:42 -05:00
parent 3ac4c0adb1
commit e15479a7dc

View File

@@ -64,14 +64,14 @@ GIT_INLINE(int) git_smart__reset_stream(transport_smart *t, bool close_subtransp
if (t->wrapped->close(t->wrapped) < 0)
return -1;
git__free(t->caps.object_format);
t->caps.object_format = NULL;
git__free(t->caps.agent);
t->caps.agent = NULL;
}
git__free(t->caps.object_format);
t->caps.object_format = NULL;
git__free(t->caps.agent);
t->caps.agent = NULL;
return 0;
}