- 13 May, 2023 5 commits
-
-
Edward Thomson committed
-
Not all systems have poll(2); emulate it with select(2).
Edward Thomson committed -
The `gitno` buffer interface is another layer on top of socket reads. Abstract it a bit into a "static string" that has `git_str` like semantics but without heap allocation which moves the actual reading logic into the socket / stream code, and allows for easier future usage of a static / stack-allocated `git_str`-like interface.
Edward Thomson committed -
Edward Thomson committed
-
`git__timer` is now `git_time_monotonic`, and returns milliseconds since an arbitrary epoch. Using a floating point to store the number of seconds elapsed was clever, as it better supports the wide range of precision from the different monotonic clocks of different systems. But we're a version control system, not a real-time clock. Milliseconds is a good enough precision for our work _and_ it's the units that system calls like `poll` take and that our users interact with. Make `git_time_monotonic` return the monotonically increasing number of milliseconds "ticked" since some arbitrary epoch.
Edward Thomson committed
-
- 12 May, 2023 1 commit
-
-
`QSORT_R` and `QSORT_S` -> `QSORT`
Edward Thomson committed
-
- 11 May, 2023 1 commit
-
-
Add `GIT_UNUSED_ARG` which is an attribute for arguments, for compatibility with dependencies.
Edward Thomson committed
-
- 09 May, 2023 1 commit
-
-
Users should provide us an array of object ids; we don't need a separate type. And especially, we should not be mutating user-providing values. Instead, use `git_oid *` in the shallow code.
Edward Thomson committed
-
- 08 May, 2023 2 commits
-
-
As reported in https://bugs.freebsd.org/271234, recent versions of FreeBSD have adjusted the prototype for qsort_r() to match the POSIX interface. This causes libgit2's CMake configuration check to fail to detect qsort_r(), making it fall back to qsort_s(), which in libgit2 also has an incompatible interface. With recent versions of clang this results in a "incompatible function pointer types" compile error. Summarizing, there are four variations of 'qsort-with-context': * old style BSD qsort_r(), used in FreeBSD 13 and earlier, where the comparison function has the context parameter first * GNU or POSIX qsort_r(), also used in FreeBSD 14 and later, where the comparison function has the context parameter last * C11 qsort_s(), where the comparison function has the context parameter last * Microsoft qsort_s(), where the comparison function has the context parameter first Add explicit detections for all these variants, so they get detected as (in the same order as above): * `GIT_QSORT_R_BSD` * `GIT_QSORT_R_GNU` * `GIT_QSORT_S_C11` * `GIT_QSORT_S_MSC` An additional complication is that on FreeBSD 14 and later, <stdlib.h> uses the C11 _Generic() macro mechanism to automatically select the correct qsort_r() prototype, depending on the caller's comparison function argument. This breaks CMake's check_prototype_definition() functionality, since it tries to redefine the function, and _Generic macro is expanded inline causing a compile error. Work around that problem by putting the function names in parentheses, to prevent the preprocessor from using a macro to replace the function name. Also, in `git__qsort_r()`, change the `#if` order so the variants that do not have to use glue are preferred.
Dimitry Andric committed -
Use SHA256 for file checksums. SHA1 makes no sense as a default in 2023. Given that we're just looking at a file checksum to see if it's changed, this does not need to take repository's OID type into account or otherwise be configurable.
Edward Thomson committed
-
- 08 Apr, 2023 1 commit
-
-
`git_filebuf` hashes contents as its written; allow for SHA1 or SHA256 as that hash. Currently, most callers simply use SHA1 as they do not yet know about SHA256 themselves.
Edward Thomson committed
-
- 21 Mar, 2023 2 commits
-
-
Add functions to use convert a string with length, instead of assuming NUL termination. In addition, move the utf8 to 16 conversion routines into the `git_utf8` namespace instead of using namespaceless `git__` prefixed names.
Edward Thomson committed -
Provide a stream interface for Schannel - the native crypto APIs - on Windows. This allows Windows to use the same HTTP transport that all the other platforms use, with its own native crypto. Ultimately this allows us to deprecate WinHTTP and we need not add support for our socket changes in two places (our HTTP stack and the WinHTTP stack).
Edward Thomson committed
-
- 10 Mar, 2023 1 commit
-
-
Including the `include/git2` build path is a seemingly unnecessary oversight to include the generated `experimental.h` file.
Edward Thomson committed
-
- 24 Feb, 2023 1 commit
-
-
Edward Thomson committed
-
- 18 Feb, 2023 1 commit
-
-
With some paths on Win32, we cannot identify the owner because it's on a file share (WSL2 or UNC). In that case, don't fail, but identify that the current user does not own the path. This matches Git for Windows behavior.
Edward Thomson committed
-
- 12 Feb, 2023 1 commit
-
-
Edward Thomson committed
-
- 10 Feb, 2023 1 commit
-
-
Try to load OpenSSL 3 libraries when compiled with OpenSSL-Dynamic support. Handle the deprecated symbol renaming of SSL_get_peer_certificate to SSL_get1_peer_certificate -- try to load the old name and if it fails, use the new one.
Edward Thomson committed
-
- 09 Feb, 2023 1 commit
-
-
The windows sysdir functions are libgit2-specific and for git compatibility only; remove them from the shared util directory and bring them into the libgit2 source tree.
Edward Thomson committed
-
- 02 Feb, 2023 1 commit
-
-
Add `OPENSSL_API_COMPAT=0x10100000L` since we use the now-deprecated low-level hash functions.
Edward Thomson committed
-
- 24 Jan, 2023 2 commits
-
-
The builtin hash uses the code verbatim from rfc6234, including prototypes for functions that we don't use (like hmac). Remove all unused prototypes to avoid collisions with things that an operating system might provide (like hmac).
Edward Thomson committed -
It conflicts with NetBSD's in its libc. Closes #6457
Thomas Klausner committed
-
- 23 Nov, 2022 1 commit
-
-
`git__noop` takes no arguments, so a simple `#define func(a) git__noop` will produce warnings about the unused `a`. Introduce `git__noop_args` to swallow arguments and avoid that warning.
Edward Thomson committed
-
- 22 Sep, 2022 2 commits
-
-
Kai Luo committed
- 19 Sep, 2022 1 commit
-
-
Edward Thomson committed
-
- 14 Aug, 2022 1 commit
-
-
Signed-off-by: Sven Strickroth <email@cs-ware.de>
Sven Strickroth committed
-
- 09 Aug, 2022 1 commit
-
-
See `/usr/include/sys/types.h` on AIX.
Kai Luo committed
-
- 08 Aug, 2022 1 commit
-
-
ensure the needed wincrypt.h is included
Christoph Cullmann committed
-
- 12 Jul, 2022 1 commit
-
-
In the ownership checks implemented for CVE-2022-24765, we disallowed users to access their own repositories when running with `sudo`. Examine the `SUDO_UID` environment variable and allow users running with `sudo`. This matches git's behavior.
Edward Thomson committed
-
- 07 Jul, 2022 3 commits
-
-
Allow the user ownership to match if the file is owned by the admin group and the user is in the admin group, even if the current process is not running as administrator directly.
Edward Thomson committed -
Refactor the file ownership checks so that callers can provide discrete information about the ownership expectations to a single function.
Edward Thomson committed -
The file ownership concepts can reflect the actual file ownership, they are not necessarily limited to mocking the interface. Rename them so that they can be more broadly applicable.
Edward Thomson committed
-
- 20 Jun, 2022 2 commits
-
-
libgit2 can be built with optional, experimental sha256 support. This allows consumers to begin testing and providing feedback for our sha256 support while we continue to develop it, and allows us to make API breaking changes while we iterate on a final sha256 implementation. The results will be `git2-experimental.dll` and installed as `git2-experimental.h` to avoid confusion with a production libgit2.
Edward Thomson committed -
Linux has a /usr/include/features.h, which gets confusing; update this to `git2_features.h` and move it into the `util` directory.
Edward Thomson committed
-
- 17 Jun, 2022 2 commits
-
-
Enforce the RFC for other protocols; Google's questionable choices about malformed SSH protocols shouldn't impact our ability to properly parse HTTPS.
Edward Thomson committed -
Provide our own url parser, so that we can handle Google Code's "fun" URLs that have a userinfo with an `@` in it.
Edward Thomson committed
-
- 13 Jun, 2022 1 commit
-
-
Edward Thomson committed
-
- 12 Apr, 2022 1 commit
-
-
Provide a mock for file ownership for testability.
Edward Thomson committed
-
- 11 Apr, 2022 1 commit
-
-
Provide individual file ownership checks for both the current user and the system user, as well as a combined current user and system user check.
Edward Thomson committed
-