Modify most of our existing refs tests to run with both filesystem-based
references and reftables. This is done by adding two new test repos
which are equivalent to our "normal" bare and non-bare testrepos, except
they use reftables as reference backend.
In order to support multiple different reference backend
implementations, git-core introduced a new "refStorage" extension that
stores the reference storage format a git client should try to use.
Let's wire up this extension for the reftable backend and allocate
different reference database backends depending on its value.
Import the reftable library from commit 994cc2f (C: formatting tweaks,
2020-06-29). This is an exact copy of the reftable library, excluding
the test framework and replacing the build system with CMake.
The reftable implementation makes use of compress2 to compress blocks,
but our bundled version of zlib doesn't include that file right now.
Let's add it to unblock the reftable dependency.
Fixes a bug likely introduced in
d396819101 (in 1.8.1) whereby
‘proxy_settings.on_status’ would be left uninitialized when using the
‘http-parser’ backend, eventually leading to a segfault in
‘http_parser_execute’. Valgrind would report use of the uninitialized
value like so:
Conditional jump or move depends on uninitialised value(s)
at 0x50CD533: http_parser_execute (http_parser.c:910)
by 0x4928504: git_http_parser_execute (httpparser.c:82)
by 0x4925C42: client_read_and_parse (httpclient.c:1178)
by 0x4926F27: git_http_client_read_response (httpclient.c:1458)
by 0x49255FE: http_stream_read (http.c:427)
by 0x4929B90: git_smart__recv (smart.c:29)
by 0x492C147: git_smart__store_refs (smart_protocol.c:58)
by 0x4929F6C: git_smart__connect (smart.c:171)
by 0x4904DCE: git_remote_connect_ext (remote.c:963)
by 0x48A15D2: clone_into (clone.c:449)
by 0x48A15D2: git__clone (clone.c:546)
by 0x4010E9: main (libgit2-proxy.c:20)
When parsing URLs, track whether the port number was explicitly
specified or not. We track this separately from whether the port is the
_default_ port. This is so that we can discern between URLs that have
the default port explicitly specified or not.
For example: scp://host:22/foo and scp://host/foo are equivalent in
terms of functionality, but are not semantically equivalent.
A user might wish to specify scp://host:22/foo in order to explicitly
ensure that we connect on port 22, which might override (for example) a
different configuration option.
When `git_odb_stream` is a read stream, `hash_ctx` is not used.
Therefore, check if `hash_ctx` can be freed during the release.
This allows implementers of custom ODB backends to not worry about
the creation of `hash_ctx` for now.
Git introduced this 100 MiB limit in commits 3c50032ff528 (attr: ignore
overly large gitattributes files, 2022-12-01) and e7c3d1ddba0b (dir.c:
reduce max pattern file size to 100MB, 2024-06-05).
Signed-off-by: Sven Strickroth <email@cs-ware.de>
People who are doing a commit expect a unified timestamp between
author and committer information when we're using the current timestamp.
Provide a single function that returns both author and committer
information so that they can have an identical timestamp when none is
specified in the environment.
Making the various pieces that create commits automatically (eg, rebase)
start paying attention to the environment variables is a Big Change.
For now, this is a big change in defaults; we should treat it as
breaking. We don't move to this by default; we may add `from_env` or
`honor_env` type of API surface in the future.