| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
IPv6 addresses should be used identically internally; we should not
denote them with brackets in one operating system and without them in
another.
|
| |
|
|\
| |
| | |
ci: run codeql
|
|/ |
|
|\
| |
| | |
pack: continue zlib while we can make progress
|
| |
| |
| |
| |
| | |
Continue the zlib stream as long as we can make progress; stop when we
stop getting output _or_ when zlib stops taking input from us.
|
|\ \
| | |
| | | |
Re-enable the RC4 test
|
| | |
| | |
| | |
| | |
| | |
| | | |
Using RC4 is not a _certificate_ problem, it's a cipher problem. The
SSL implementation should and will fail with an unrecoverable error
(-1). There's no opportunity to accept/continue.
|
|/ /
| |
| |
| |
| |
| | |
This used to fail with an error indicating a mis-use of OpenSSL on platforms
using it due to poor error handling. Re-enable it even if this isn't the right
error code to use for now.
|
|\ \
| | |
| | | |
Cache the parsed submodule config when diffing
|
| | | |
|
| | |
| | |
| | |
| | | |
Also repurposed an unused function and deleted another one.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This change makes that anything that calls `git_diff__from_iterators`
(any of the `git_diff_xxx` functions) only need to parse the
`.gitmodules` file once. This can be avoided by calling
`git_repository_submodule_cache_all(...)`, but we can do that safely for
the user with no change in semantics.
Fixes: #5725
|
|\ \
| | |
| | | |
Make git__strntol64() ~70%* faster
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This change uses compiler intrinsics to detect overflows instead of
using divisions to detect potential overflow. This makes the code faster
and makes it easier to read as a bonus side-effect!
Some of the things this quickens:
* Config parsing.
* Tree parsing.
* Smart protocol negotiation.
\* Measured by running `libgit2_clar` with `-fno-optimize-sibling-calls
-fno-omit-frame-pointer` under `perf(1)`:
```shell
$ perf diff --symbols=git__strntol64 --compute=ratio \
--percentage=absolute baseline.data perf.data
\# Event 'cycles'
\#
\# Baseline Ratio Shared Object
\# ........ .............. .............
\#
0.25% 0.321836 libgit2_clar
```
|
|\ \
| | |
| | | |
winhttp: support optional client cert
|
| | | |
|
| | | |
|
| | | |
|
| |/
|/| |
|
|\ \
| | |
| | | |
git.git-authors: Replacing his/her with their
|
|/ / |
|
|\ \
| | |
| | | |
Friendlier getting started in the lack of git_libgit2_init
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We require the library to be initialized with git_libgit2_init before it
is functional. However, if a user tries to uses the library without
doing so - as they might when getting started with the library for the
first time - we will likely crash.
This commit introduces some guard rails - now instead of having _no_
allocator by default, we'll have an allocator that always fails, and
never tries to set an error message (since the thread-local state is
set up by git_libgit2_init). We've modified the error retrieval
function to (try to) ensure that the library has been initialized before
getting the thread-local error message.
(Unfortunately, we cannot determine if the thread local storage has
actually been configured, this does require initialization by
git_libgit2_init. But a naive attempt should be good enough for most
cases.)
|
|/ /
| |
| |
| |
| |
| | |
A function to provide the initialization count of the library; this is
subject to race conditions but is useful for a naive determination as to
whether the library has been initialized or not.
|
|\ \
| | |
| | | |
Thread-local storage: a generic internal library (with no allocations)
|
| | | |
|
| | |
| | |
| | |
| | | |
Use a no-allocation approach to the TLS data abstraction.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Provide more clarity for Win32 calling conventions - now that we always
compile to __cdecl on Win32, we'll define that as the the libgit2
calling convention. Also offer NTAPI (__stdcall) calling conventions
for things that need callbacks from NTAPI code (eg fiber-local storage).
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This adds a generic TLS interface for anyone to store TLS data. It is designed to work regardless of whether threading support is built into the library or not.
Nobody in the library should directly interface with the data on the TLS struct, so it's been built to be opaque even in the library.
Requires the allocator to be initialized before use.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Clarify the `git_atomic` type and functions now that we have a 64 bit
version as well (`git_atomic64`).
|
|/ /
| |
| |
| |
| |
| | |
The number of CPUs is useful information for creating a thread pool or a
number of workers, but it's not really about threading directly. Evict
it from the thread file
|
|\ \
| | |
| | | |
Thread-free implementation
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
Our git_packbuilder__cache_lock function returns a value; use git__noop.
|
|/ /
| |
| |
| |
| | |
The git__noop function is more largely useful; move it into the
util header. (And reduce the number of underscores.)
|
|\ \
| | |
| | | |
Make the pack and mwindow implementations data-race-free
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This change fixes a packfile heap corruption that can happen when
interacting with multiple packfiles concurrently across multiple
threads. This is exacerbated by setting a lower mwindow open file limit.
This change:
* Renames most of the internal methods in pack.c to clearly indicate
that they expect to be called with a certain lock held, making
reasoning about the state of locks a bit easier.
* Splits the `git_pack_file` lock in two: the one in `git_pack_file`
only protects the `index_map`. The protection to `git_mwindow_file` is
now in that struct.
* Explicitly checks for freshness of the `git_pack_file` in
`git_packfile_unpack_header`: this allows the mwindow implementation
to close files whenever there is enough cache pressure, and
`git_packfile_unpack_header` will reopen the packfile if needed.
* After a call to `p_munmap()`, the `data` and `len` fields are poisoned
with `NULL` to make use-after-frees more evident and crash rather than
being open to the possibility of heap corruption.
* Adds a test case to prevent this from regressing in the future.
Fixes: #5591
|
|\ \ \
| |/ /
| | | |
Make the odb race-free
|
|/ /
| |
| |
| |
| |
| |
| | |
This change adds all the necessary locking to the odb to avoid races in
the backends.
Part of: #5592
|
|\ \
| | |
| | | |
Also add the raw hostkey to `git_cert_hostkey`
|
| | |
| | |
| | |
| | |
| | | |
`git_cert_x509` has the raw encoded certificate. Let's do the same for
the SSH certificate for symmetry.
|