| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
util: detect all possible qsort_r and qsort_s variants
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Support SHA256 in git_repository_wrap_odb
|
| | |
|
|/ |
|
|\ |
|
|/
|
|
|
| |
... otherwise git_tree__parse_raw() will fail to obtain
the correct oid size, which causes the entire parse to fail.
|
|\
| |
| | |
sha256: less hardcoded SHA1 types and lengths
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
The config file checksum is only used to detect changes internally -- it
is not stored within the repository. Therefore this need not be
configurable.
Use SHA256 everywhere, regardless of the repository object format.
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Our thread-local sha string buffer should be sized to support SHA256
strings.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
`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.
|
|\ \
| | |
| | | |
xdiff: move xdiff to 'deps'
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
xdiff is a dependency (from git core) and more properly belongs in the
'deps' directory. Move it there, and add a stub for cmake to resolve
xdiff from the system location in the future. (At present, bundled xdiff
remains hardcoded.)
|
|\ \ \
| | | |
| | | | |
meta: the main branch is now v1.7.0
|
|/ / / |
|
|\ \ \
| |_|/
|/| | |
config: return `GIT_ENOTFOUND` for missing programdata
|
|/ /
| |
| |
| |
| |
| | |
When the programdata path is missing, ensure that we pass down the
`GIT_ENOTFOUND` error to the caller instead of converting it to a
generic `-1`.
|
|\ \
| | |
| | | |
repo: honor environment variables for more scenarios
|
| | |
| | |
| | |
| | |
| | |
| | | |
When the repository is opened with `GIT_REPOSITORY_OPEN_FROM_ENV`, honor
the `GIT_CONFIG_GLOBAL`, `GIT_CONFIG_SYSTEM` and `GIT_CONFIG_NOSYSTEM`
environment variables.
|
| | |
| | |
| | |
| | |
| | | |
When the repository is opened with `GIT_REPOSITORY_OPEN_FROM_ENV`, honor
the `GIT_COMMON_DIR` environment variable.
|
| | |
| | |
| | |
| | |
| | | |
When the repository is opened with `GIT_REPOSITORY_OPEN_FROM_ENV`, honor
the `GIT_WORK_TREE` environment variable.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Remove the `_git_repository_open_ext_from_env` and make it part of the
general repository opening code path. This removes the re-entrancy, and
standardizes things like index and config opening to a single place
again so that we have predictable ordering of the opening procedure.
|