Commit Graph

14200 Commits

Author SHA1 Message Date
Edward Thomson
489aec4447 fuzzers: declare standalone functions 2021-11-11 17:11:25 -05:00
Edward Thomson
0429894e0b tests: declare trace handler as static 2021-11-11 17:11:25 -05:00
Edward Thomson
49f03c0305 tests: include test declarations for old gcc
Older versions of gcc do not believe that we've adequately declared our
test functions.  Include `clar_suite.h` conditionally for those old
versions.  Do not do this on newer compilers to avoid unnecessary
recompilation of the entire suite when we add or remove a test function.
2021-11-11 17:11:24 -05:00
Edward Thomson
cf522050bf clar: emit clar_suite.h with test declarations
We may want to have test function declarations; produce a header file
with (only) the test declarations.  Update clar to avoid overwriting the
file unnecessarily to avoid bumping timestamps and potentially
recompiling unnecessarily.
2021-11-11 17:11:24 -05:00
Edward Thomson
7687948ac1 Merge pull request #6112 from libgit2/ethomson/cmake3
cmake refactorings
2021-11-11 16:13:38 -05:00
Edward Thomson
42205e72d7 Merge pull request #6111 from libgit2/ethomson/str_free
str: git_str_free is never a function
2021-11-11 16:09:49 -05:00
Edward Thomson
4e84ddd5b0 cmake: refactor zlib selection
Move zlib selection into its own cmake module.
2021-11-11 15:56:11 -05:00
Edward Thomson
83fa548078 cmake: refactor WinHTTP selection
Move WinHTTP selection into its own cmake module.
2021-11-11 15:56:11 -05:00
Edward Thomson
e35a22a080 cmake: refactor libssh2 selection
Move SSH selection into its own cmake module.
2021-11-11 15:56:11 -05:00
Edward Thomson
f0cb3788db cmake: refactor regex selection
Move regex selection into its own cmake module.
2021-11-11 15:56:11 -05:00
Edward Thomson
de178d36ff cmake: refactor http_parser selection
Move http_parser selection into its own cmake module.
2021-11-11 15:56:11 -05:00
Edward Thomson
16b6e3a9c9 cmake: HTTP_Parser is now HTTPParser 2021-11-11 15:56:11 -05:00
Edward Thomson
19e99de054 cmake: qsort detection in features.h 2021-11-11 15:56:11 -05:00
Edward Thomson
d3a7a352d5 cmake: move test enablement into test cmake 2021-11-11 15:56:10 -05:00
Edward Thomson
207beff541 cmake: reorganize file 2021-11-11 15:56:10 -05:00
Edward Thomson
4d2a6839dc cmake: move fuzzer args to the fuzzer's cmake 2021-11-11 15:56:10 -05:00
Edward Thomson
7b527c12bc cmake: move deprecation definition to src/
There's no need to add the deprecation at the top-level.  Our tests add
deprecation explicitly.
2021-11-11 15:56:10 -05:00
Edward Thomson
9f37457e17 cmake: move cflag defaults into a separate module 2021-11-11 15:56:10 -05:00
Edward Thomson
6c00fcb767 cmake: USE_SSH is not on by default 2021-11-11 15:56:10 -05:00
Edward Thomson
789ab91560 cmake: standardize USE_WINHTTP
WinHTTP can now be disabled with `USE_WINHTTP=OFF` instead of
`WINHTTP=OFF` to better support the other cmake semantics.
2021-11-11 15:56:10 -05:00
Edward Thomson
9324d16e73 cmake: standardize USE_THREADS and USE_NSEC
Threading can now be disabled with `USE_THREADS=OFF` instead of
`THREADSAFE=OFF` to better support the other cmake semantics.

Nanosecond support is the default _if_ we can detect it.  This should be
our default always - like threads - and people can opt out explicitly.
2021-11-11 15:56:10 -05:00
Edward Thomson
08047ca012 str: git_str_free is never a function 2021-11-11 15:46:41 -05:00
Edward Thomson
ceddeed80a Merge pull request #6104 from libgit2/ethomson/path
path: refactor utility path functions
2021-11-11 15:20:50 -05:00
Edward Thomson
9ab351c0d5 Merge pull request #6107 from joshtriplett/refresh-handling
Support checking for object existence without refresh
2021-11-11 15:14:59 -05:00
Edward Thomson
dfd5b32f35 Merge pull request #6109 from joshtriplett/document-odb-race-free
Document that `git_odb` is thread-safe
2021-11-11 15:10:37 -05:00
Josh Triplett
644c763b76 Document that git_odb is thread-safe
Commit 4ae41f9c63 made `git_odb`
race-free, and added internal locking. Update `docs/threading.md`
accordingly, so that APIs built atop libgit2 (e.g. language bindings)
can count on this.
2021-11-11 00:30:40 +01:00
Edward Thomson
1a8b2922d9 win32: include correct path header 2021-11-09 15:17:19 +00:00
Edward Thomson
1217c5b232 fs_path: remove now-unused validation functions 2021-11-09 15:17:18 +00:00
Edward Thomson
622514095f fs_path: add length with suffix validation 2021-11-09 15:17:18 +00:00
Edward Thomson
91246ee5e0 path: use new length validation functions 2021-11-09 15:17:18 +00:00
Edward Thomson
1728e27c96 path: length validation respecting core.longpaths
Teach `git_path_is_valid` to respect `core.longpaths`.  Add helper
methods to validate length and set the error message appropriately.
2021-11-09 15:17:18 +00:00
Edward Thomson
315a43b2f1 path: introduce git_path_str_is_valid
Add a `git_str` based validity check; the existing `git_path_is_valid`
defers to it.
2021-11-09 15:17:18 +00:00
Edward Thomson
ebacd24c60 fs_path: add long path validation on windows 2021-11-09 15:17:18 +00:00
Edward Thomson
dd748dbede fs_path: make empty component validation optional 2021-11-09 15:17:17 +00:00
Edward Thomson
bef02d3e63 fs_path: introduce str_is_valid
Provide a mechanism for users to limit the number of characters that are
examined; `git_fs_path_str_is_valid` and friends will only examine up to
`str->size` bytes.

`git_fs_path_is_valid` delegates to these new functions by passing
`SIZE_MAX` (instead of doing a `strlen`), which is a sentinel value
meaning "look for a NUL terminator".
2021-11-09 15:17:17 +00:00
Edward Thomson
63e36c53ca path: validate -> is_valid
Since we're returning a boolean about validation, the name is more
properly "is valid".
2021-11-09 15:17:17 +00:00
Edward Thomson
434a46107b fs_path: validate -> is_valid
Since we're returning a boolean about validation, the name is more
properly "is valid".
2021-11-09 15:17:17 +00:00
Edward Thomson
95117d4744 path: separate git-specific path functions from util
Introduce `git_fs_path`, which operates on generic filesystem paths.
`git_path` will be kept for only git-specific path functionality (for
example, checking for `.git` in a path).
2021-11-09 15:17:17 +00:00
Edward Thomson
44ec8b5cdf Merge pull request #6108 from libgit2/ethomson/docs_ci
ci: only update docs on push
2021-11-09 09:38:53 -05:00
Edward Thomson
51f6f15d71 ci: only update docs on push
Only update the documentation on a `push`.  We were previously updating the documentation only when not in a `pull_request`, which meant that we would push documentation updates in manual build triggers.
2021-11-09 09:03:06 -05:00
Josh Triplett
f45ff6c92d Omit trailing comma on enum
To accommodate less capable compilers.

Co-authored-by: Peter Pettersson <85582231+boretrk@users.noreply.github.com>
2021-11-08 17:33:35 +01:00
Josh Triplett
94cb060c37 Add tests for ODB refresh
Add optional refreshing in the fake backend, and count the number of
refresh calls if enabled.
2021-11-08 14:59:28 +01:00
Josh Triplett
81662d432c Support checking for object existence without refresh
Looking up a non-existent object currently always invokes
`git_odb_refresh`. If looking up a large batch of objects, many of which
may legitimately not exist, this will repeatedly refresh the ODB to no
avail.

Add a `git_odb_exists_ext` that accepts flags controlling the ODB
lookup, and add a flag to suppress the refresh. This allows the user to
control if and when they refresh (for instance, refreshing once before
starting the batch).
2021-11-08 14:59:01 +01:00
Josh Triplett
3993e9aebc Update documentation for ODB backend refresh logic
Commit b1a6c316a6 moved auto-refresh into
the pack backend, and added a comment accordingly. Commit
43820f204e moved auto-refresh back *out*
of backends into the ODB layer, but didn't update the comment.
2021-11-08 14:01:14 +01:00
Edward Thomson
358a60e1b4 Merge pull request #6100 from mkhl/tests/instead-of-clar
libgit2_clar is now libgit2_tests
2021-10-28 11:27:28 -04:00
Martin Kühl
f66e7f36ff libgit2_clar is now libgit2_tests
in #6083 the test runner was renamed to libgit2_tests,
but not all references to the old name were updated.
this change changes all of them to use the new name.
2021-10-28 10:25:09 +02:00
Edward Thomson
9b04a3076d Merge pull request #6084 from libgit2/ethomson/cmake
cmake: cleanups and consistency
2021-10-18 08:54:36 -04:00
Edward Thomson
52693ab44e cmake: stylistic refactoring
Ensure that we always use lowercase function names, and that we do not
have spaces preceding open parentheses, for consistency.
2021-10-18 08:30:14 -04:00
Edward Thomson
e1be28c7cc cmake: remove unused STDCALL option
The `STDCALL` option was removed; remove the (unreachable) error
message.
2021-10-18 08:30:14 -04:00
Edward Thomson
8507bf81ea trace: always enabled
There's no need to make tracing opt-in; it should always be included.
2021-10-18 08:30:14 -04:00