| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
| |
Not all systems have poll(2); emulate it with select(2).
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`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.
|
| |\
| |
| | |
Update xdiff to git 2.40.1's version
|
| | |
| |
| |
| |
| | |
Add `GIT_UNUSED_ARG` which is an attribute for arguments, for
compatibility with dependencies.
|
| |\ \
| |/
|/| |
Work around -Werror problems when detecting qsort variants
|
| | |
| |
| |
| | |
`QSORT_R` and `QSORT_S` -> `QSORT`
|
| |\ \
| |/
|/| |
Shallow (#6396) with some fixes from review
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |\ |
|
| | |\ \ |
|
| | | | | |
|
| | |_|/
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
`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.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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).
|
| | |/
|/|
| |
| |
| | |
Including the `include/git2` build path is a seemingly unnecessary
oversight to include the generated `experimental.h` file.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
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.
|
| |\ \
| | |
| | | |
SHA256: more SHA256 support
|
| | | | |
|
| |\ \ \
| | | |
| | | | |
Support the notion of a home directory separately from global configuration directory
|
| | |/ /
| | |
| | |
| | |
| | |
| | | |
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.
|
| |\ \ \
| | | |
| | | | |
Define correct off64_t for AIX
|
| | | | |
| | | |
| | | |
| | | | |
This reverts commit 1fde70bb607c7ba471db359f045affd1f5625e5d.
|
| | | | | |
|
| | | |/
| |/|
| | |
| | | |
See `/usr/include/sys/types.h` on AIX.
|
| | |/
|/|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| | |
Add `OPENSSL_API_COMPAT=0x10100000L` since we use the now-deprecated
low-level hash functions.
|
| | |
| |
| |
| |
| |
| |
| | |
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).
|
| | |
| |
| |
| |
| |
| | |
It conflicts with NetBSD's in its libc.
Closes #6457
|
| | |
| |
| |
| |
| |
| | |
`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.
|
| |\ \
| | |
| | | |
URL parsing for google-compatible URLs
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Enforce the RFC for other protocols; Google's questionable choices about
malformed SSH protocols shouldn't impact our ability to properly parse
HTTPS.
|
| | | |
| | |
| | |
| | |
| | | |
Provide our own url parser, so that we can handle Google Code's "fun"
URLs that have a userinfo with an `@` in it. :cry:
|
| |\ \ \
| | | |
| | | | |
Fix memory leak
|
| | | |/
| |/|
| | |
| | | |
Signed-off-by: Sven Strickroth <email@cs-ware.de>
|
| | | | |
|
| |/ /
| |
| |
| | |
ensure the needed wincrypt.h is included
|
| |\ \
| | |
| | | |
RFC: SHA256 proof of concept
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |/
| |
| |
| |
| | |
Linux has a /usr/include/features.h, which gets confusing; update this
to `git2_features.h` and move it into the `util` directory.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| | |
Refactor the file ownership checks so that callers can provide discrete
information about the ownership expectations to a single function.
|
| |/
|
|
|
|
| |
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.
|
| | |
|