summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* object: introduce a raw content validation functionethomson/object_validationEdward Thomson2021-11-303-0/+104
| | | | | Users may want to validate raw object content; provide them a function to do so.
* object: return GIT_EINVALID on parse errorsEdward Thomson2021-11-308-39/+69
| | | | | | | | | | | | | | Return `GIT_EINVALID` on parse errors so that direct callers of parse functions can determine when there was a failure to parse the object. The object parser functions will swallow this error code to prevent it from propagating down the chain to end-users. (`git_merge` should not return `GIT_EINVALID` when a commit it tries to look up is not valid, this would be too vague to be useful.) The only public function that this affects is `git_signature_from_buffer`, which is now documented as returning `GIT_EINVALID` when appropriate.
* Merge pull request #6122 from libgit2/ethomson/cleanupEdward Thomson2021-11-3029-70/+60
|\ | | | | Minor code cleanups
| * cmake: use CMAKE_SOURCE_DIR and CMAKE_BINARY_DIRethomson/cleanupEdward Thomson2021-11-229-33/+31
| | | | | | | | | | | | Instead of using the project-specific `libgit2_SOURCE_DIR` and `libgit2_BINARY_DIR` variables, use `CMAKE_SOURCE_DIR` and `CMAKE_BINARY_DIR`.
| * filebuf: use hashes not oidsEdward Thomson2021-11-224-6/+6
| | | | | | | | | | The filebuf functions should use hashes directly, not indirectly using the oid functions.
| * sha1: tests should use hashes, not oid computationEdward Thomson2021-11-221-11/+17
| | | | | | | | | | | | The tests that examine sha1 behavior (including collision detection) should test against the hash functionality directly, not indirectly using the oid functions.
| * util: don't include unnecessary system librariesEdward Thomson2021-11-2214-20/+5
| | | | | | | | Remove some unnecessary includes from utility code.
| * utf8: include `utf8.h` in testsEdward Thomson2021-11-191-0/+1
| |
* | Merge pull request #6106 from ammgws/fixtemplateerrEdward Thomson2021-11-222-1/+16
|\ \ | |/ |/| Fix repo init when template dir is non-existent
| * repo: minor formatting fixEdward Thomson2021-11-221-2/+1
| |
| * tests: try to init with non-existent template pathJason Nader2021-11-121-0/+10
| |
| * repository: do not copy templates if dir nonexistentJason Nader2021-11-121-1/+7
| | | | | | | | | | This mimics the behaviour of git which just prints a warning and continues with the repo initialisation.
* | Merge pull request #6121 from libgit2/ethomson/dateEdward Thomson2021-11-197-61/+76
|\ \ | | | | | | util: minor cleanup and refactoring to the date class
| * | date: rfc2822 formatting uses a `git_buf` instead of a static stringethomson/dateEdward Thomson2021-11-195-39/+39
| | |
| * | date: make it a proper `git_date` utility classEdward Thomson2021-11-187-32/+47
|/ / | | | | | | Instead of `git__date`, just use `git_date`.
* | Merge pull request #6120 from libgit2/ethomson/cmake_testEdward Thomson2021-11-173-3/+2
|\ \ | | | | | | cmake: re-enable WinHTTP
| * | cmake: use WINHTTP when USE_WINHTTP is specifiedethomson/cmake_testEdward Thomson2021-11-171-1/+1
| | |
| * | cmake: enable testing at the top levelEdward Thomson2021-11-172-2/+1
|/ / | | | | | | | | | | | | Ensure that we `enable_testing()` at the top-level CMakeLists.txt or else we'll need to navigate within the build directory to the correct place in the hierarchy to run `ctest`. Now we can `ctest` at the top-level again.
* | Merge pull request #6119 from libgit2/ethomson/tag_validEdward Thomson2021-11-161-0/+2
|\ \ | | | | | | tag: set validity to 0 by default
| * | tag: set validity to 0 by defaultethomson/tag_validEdward Thomson2021-11-161-0/+2
|/ / | | | | | | | | `git_tag_name_is_valid` needs to set validity to 0 when it short-circuits.
* | cmake: better explain why headertests existsEdward Thomson2021-11-161-3/+8
| |
* | Make enum in src,tests and examples C90 compliant by removing trailing comma.Peter Pettersson2021-11-1537-46/+46
| |
* | ntmlclient: make enum C90 compliant by removing trailing commaPeter Pettersson2021-11-152-6/+6
| |
* | Make enum in includes C90 compliant by removing trailing comma.Peter Pettersson2021-11-1538-72/+72
| |
* | Add target for testing libgit2 headersPeter Pettersson2021-11-152-1/+26
| |
* | Merge pull request #6114 from libgit2/ethomson/cmake5Edward Thomson2021-11-1430-866/+747
|\ \ | | | | | | cmake: further refactorings
| * | cmake: move sha1 source selection into CMakeLists.txtEdward Thomson2021-11-142-12/+17
| | | | | | | | | | | | | | | The select hashes module selects the hash; the CMakeLists.txt selects the files to implement it.
| * | cmake: use a string not a boolean for LIBGIT2_FILENAMEEdward Thomson2021-11-141-1/+1
| | |
| * | cmake: refactor global variablesEdward Thomson2021-11-1412-59/+58
| | | | | | | | | | | | | | | Update the global variables `LIBGIT2_OBJECTS` to `LIBGIT2_DEPENDENCY_OBJECTS` for clarity and consistency.
| * | cmake: reformat modulesEdward Thomson2021-11-1420-812/+689
|/ / | | | | | | Apply the standard project cmake formatting to the modules.
* | Merge pull request #6116 from ↵Edward Thomson2021-11-141-1/+1
|\ \ | | | | | | | | | lhchavez/drop-volatile-qualifier-in-atomic-exchange
| * | Fix a gcc 11 warning in src/thread.hlhchavez2021-11-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building under gcc 11, there is a warning about an incompatible pointer type, since [`__atomic_exchange`](https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html) does not take `volatile` pointers: ``` In file included from ../src/common.h:81, from ../src/transports/winhttp.c:8: ../src/thread-utils.h: In function ‘git___swap’: ../src/thread-utils.h:168:9: warning: argument 3 of ‘__atomic_exchange’ discards ‘volatile’ qualifier [-Wincompatible-pointer-types] 168 | __atomic_exchange(ptr, &newval, &foundval, __ATOMIC_SEQ_CST); | ^~~~~~~~~~~~~~~~~ ``` This change drops the `volatile` qualifier so that the pointer type matches what `__atomic_exchange` expects.
* | | Merge pull request #6115 from lhchavez/fix-indentation-threadstateEdward Thomson2021-11-141-2/+2
|\ \ \ | |/ / |/| |
| * | Fix a gcc 11 warning in src/threadstate.clhchavez2021-11-141-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building under gcc 11, there is a warning about a misaligned guard clause because there were mixed spaces and tabs: ``` [128/634] Building C object src/CMakeFiles/git2internal.dir/threadstate.c.o ../src/threadstate.c: In function ‘threadstate_dispose’: ../src/threadstate.c:39:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 39 | if (threadstate->error_t.message != git_str__initstr) | ^~ ../src/threadstate.c:41:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 41 | threadstate->error_t.message = NULL; | ^~~~~~~~~~~ ../src/threadstate.c: At top level: ``` This change indents the code with tabs for consistency with the rest of the code, which makes the warning go away.
* | Merge pull request #6113 from libgit2/ethomson/cmake3Edward Thomson2021-11-1156-111/+570
|\ \ | | | | | | Add missing-declarations warning globally
| * | cmake: move missing-declarations warning to top-levelEdward Thomson2021-11-112-2/+1
| | | | | | | | | | | | | | | We should enforce declarations throughout the code-base, including examples, fuzzers and tests, not just in the `src` tree.
| * | tests: include function declarationsEdward Thomson2021-11-115-4/+13
| | |
| * | test: correct test namesEdward Thomson2021-11-113-3/+3
| | |
| * | tests: declare functions statically where appropriateEdward Thomson2021-11-1134-60/+442
| | |
| * | clar: declare summary functions as staticEdward Thomson2021-11-111-5/+5
| | |
| * | example: declare print_usage functionEdward Thomson2021-11-111-1/+1
| | |
| * | examples: remove unused functionEdward Thomson2021-11-111-15/+0
| | |
| * | fuzzers: declare static functions as staticEdward Thomson2021-11-112-4/+4
| | |
| * | fuzzers: declare standalone functionsEdward Thomson2021-11-119-2/+29
| | |
| * | tests: declare trace handler as staticEdward Thomson2021-11-111-1/+1
| | |
| * | tests: include test declarations for old gccEdward Thomson2021-11-111-1/+9
| | | | | | | | | | | | | | | | | | | | | 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.
| * | clar: emit `clar_suite.h` with test declarationsEdward Thomson2021-11-111-13/+62
|/ / | | | | | | | | | | | | 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.
* | Merge pull request #6112 from libgit2/ethomson/cmake3Edward Thomson2021-11-1120-428/+422
|\ \ | | | | | | cmake refactorings
| * | cmake: refactor zlib selectionethomson/cmake3Edward Thomson2021-11-112-33/+35
| | | | | | | | | | | | Move zlib selection into its own cmake module.
| * | cmake: refactor WinHTTP selectionEdward Thomson2021-11-112-18/+18
| | | | | | | | | | | | Move WinHTTP selection into its own cmake module.