tests


Log

Author Commit Date CI Message
Edward Thomson 4161ebdd 2022-04-11T21:31:25 repo: make ownership checks optional Introduce the `GIT_OPT_SET_OWNER_VALIDATION` option, so that users can disable repository ownership validation.
Edward Thomson 90d2b619 2022-04-11T17:07:20 repo: test configuration ownership validation Test that we prevent opening directories that are not owned by ourselves.
Edward Thomson fa366921 2022-04-11T15:18:44 repo: honor safe.directory during ownership checks Obey the `safe.directory` configuration variable if it is set in the global or system configuration. (Do not try to load this from the repository configuration - to avoid malicious repositories that then mark themselves as safe.)
Edward Thomson bf2620bc 2022-04-10T21:29:43 fs_path: refactor ownership checks into current user and system 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 606afeda 2022-04-10T09:44:41 Merge pull request #6244 from jorio/fix-diff_delta_format_path-crash Fix crash when regenerating a patch with unquoted spaces in filename
Edward Thomson e7fce1b5 2022-04-06T10:22:29 tests: support flaky stat The 32-bit ARM QEMU builds are flaky when running `lstat`. Disable those testing `lstat`'s `st_size` temporarily.
Edward Thomson 4e85b4fc 2022-04-05T22:40:43 Merge pull request #6259 from libgit2/ethomson/diff_arm32 diff: don't stat empty file on arm32 (flaky test)
Edward Thomson d8015d28 2022-04-04T13:30:27 Merge pull request #6251 from libgit2/ethomson/oid_fetch fetch: support OID refspec without dst
Edward Thomson 42093d6a 2022-04-04T11:40:42 diff: don't stat empty file on arm32 (flaky test) Our CI test infrastructure virtualizes arm32 in docker, which is a sometimes imperfect situation. In `diff::workdir::can_diff_empty_file`, avoid the stat to ensure that the file is zero bytes; there is an odd issue running in qemu when emulating arm32 that we should skip.
Edward Thomson ce78c83b 2021-12-13T15:31:21 sha: ensure we test both cng and cryptoapi on windows When GIT_SHA1_WIN32 or GIT_SHA256_WIN32 is used, ensure that we test both CryptoNG ("cng") and CryptoAPI.
Edward Thomson b900981c 2021-12-12T14:25:25 sha: add sha256 algorithm Add support for a SHA256 hash algorithm, and add the "builtin" SHA256 hash engine (from RFC 6234).
Edward Thomson 3a08bc43 2022-03-23T08:38:23 Merge pull request #6235 from libgit2/ethomson/cli_benchmarks Benchmarking suite
Edward Thomson a9a7967a 2022-03-22T22:16:57 fetch: support OID refspec without dst Support the ability to create a refspec that is a single object ID without a destination.
Edward Thomson a1020a7f 2022-03-22T23:05:48 clone: update bitbucket tests
Iliyas Jorio 11866327 2022-03-13T17:36:48 test: add test that regenerates patches with spaces in filename This currently crashes, proposed fix in subsequent commit.
Edward Thomson 93037bab 2022-02-22T22:00:37 tests: add benchmark tests Add a benchmark test suite that wraps hyperfine and is suitable for producing data about test runs of a CLI or A/B testing CLIs.
Edward Thomson d9b041e6 2022-02-27T09:20:58 assert: add `ASSERT_WITH_CLEANUP` Now that we safely assert and return, we may need to be in a place where we need to unlock mutexes or cleanup resources. Provide `ASSERT_WITH_CLEANUP` that permits for this behavior by taking a block.
Edward Thomson d02f4f7a 2021-11-17T14:31:29 cmake: refactor `add_clar_test` into separate module
Edward Thomson e6d93612 2021-11-16T23:59:43 refactor: move utility tests into util
Edward Thomson 2b09b5d7 2021-11-16T23:47:14 refactor: move headertest into separate test folder
Edward Thomson 25bc84fb 2021-11-16T23:41:00 refactor: move clar into separate directory
Edward Thomson 3344fddc 2021-11-16T23:29:22 refactor: `tests` is now `tests/libgit2` Like we want to separate libgit2 and utility source code, we want to separate libgit2 and utility tests. Start by moving all the tests into libgit2.
Edward Thomson 5fcfada5 2021-11-15T07:45:16 cmake: document CMakeLists.txt hierarchy
Edward Thomson eca9e1cf 2022-02-22T07:17:12 Merge pull request #6228 from libgit2/ethomson/win32_systemdirs win32: `find_system_dirs` does not return `GIT_ENOTFOUND`
Edward Thomson f45121ed 2022-02-21T16:13:52 win32: `find_system_dirs` does not return `GIT_ENOTFOUND` Allow for no Git for Windows installation. When there is no GfW found in the path or registry, `git_win32__find_system_dirs` would return a `GIT_ENOTFOUND`. Callers were not expecting this. Since this is no error, we simply return `0` so that callers can move on with their lives.
Carlos Martín Nieto e35b5e44 2022-02-21T10:34:13 test: add test for the behaviour of update_tips on error
Edward Thomson e1415dc3 2022-02-11T11:02:00 diff_file: test empty workdir file grows after obtaining a diff This test was also provided by @jorio https://github.com/libgit2/libgit2/pull/6208#issuecomment-1034072050
Iliyas Jorio 9aade20b 2022-02-09T19:04:52 diff_file: test workdir file becomes empty after obtaining a diff
Iliyas Jorio 0a0cd67d 2022-02-08T20:18:15 diff_file: fix crash if size of diffed file changes in workdir "diff_file_content_load_workdir_file()" maps a file from the workdir into memory. It uses git_diff_file.size to determine the size of the memory mapping. If this value goes stale, the mmaped area would be sized incorrectly. This could occur if an external program changes the contents of the file after libgit2 had cached its size. This used to segfault if the file becomes smaller (mmaped area too large). This patch causes diff_file_content_load_workdir_file to fail without crashing if it detects that the file size has changed.
Edward Thomson 1d811f0e 2022-02-11T07:14:54 Merge pull request #6203 from libgit2/ethomson/fetch_by_oid Fetch by object id
Edward Thomson d9863fc1 2022-02-06T15:27:34 Merge pull request #6192 from libgit2/ethomson/sha256_preparation SHA256: early preparation
Edward Thomson 9d88300a 2022-02-05T12:35:46 fetch: support oids in fetch specs
Edward Thomson 07264ea7 2022-02-06T14:07:36 fetch: add a test for local fetching
Edward Thomson b82d5664 2022-02-05T09:03:37 oid: introduce git_oid__is_hexstr Introduce a function that determines whether a given string is a valid object id (40 chars of hexadigits).
Edward Thomson 4efd6563 2022-02-03T16:39:26 Merge pull request #6196 from libgit2/ethomson/at_revparse revparse: support bare '@'
Edward Thomson 61f1e31a 2022-02-02T22:35:18 Merge pull request #6197 from libgit2/ethomson/merge_msg_conflict_comment merge: comment conflicts lines in MERGE_MSG
Edward Thomson 18a477e7 2022-02-02T22:35:07 Merge pull request #6195 from libgit2/ethomson/zdiff3 merge: support zdiff3 conflict styles
Edward Thomson c0297d47 2022-01-30T22:38:08 merge: comment conflicts lines in MERGE_MSG git has started adding comment markers to its conflict lines in MERGE_MSG. Match that behavior.
Edward Thomson add2dabb 2022-01-30T22:25:59 revparse: support bare '@' A bare '@' revision syntax represents HEAD. Support it as such.
Edward Thomson 84e1e560 2022-01-30T19:22:38 Merge branch 'boretrk/futils_mktmp'
Edward Thomson aae54d5b 2022-01-30T13:43:43 Merge pull request #6138 from ccstolley/ccs_packedrefs_fast refs: Speed up packed lookups.
Edward Thomson c629d2a1 2022-01-29T21:02:15 merge: support zdiff3 conflict styles
Edward Thomson 70d9bfa4 2022-01-22T17:34:36 packbuilder: use the packfile name instead of hash Deprecate the `git_packfile_hash` function. Callers should use the new `git_packfile_name` function which provides a unique packfile name.
Edward Thomson d2458af7 2022-01-22T14:19:13 indexer: use a byte array for checksum The index's checksum is not an object ID, so we should not use the `git_oid` type. Use a byte array for checksum calculation and storage. Deprecate the `git_indexer_hash` function. Callers should use the new `git_indexer_name` function which provides a unique packfile name.
Edward Thomson 11ef76a9 2022-01-22T13:31:02 index: use a byte array for checksum The index's checksum is not an object ID, so we should not use the `git_oid` type. Use a byte array for checksum calculation and storage. Deprecate the `git_index_checksum` function without a replacement. This is an abstraction that callers should not care about (and indeed do not seem to be using). Remove the unused `git_index__changed_relative_to` function.
Edward Thomson 74471eef 2022-01-21T19:11:18 commit_graph: tests are now `commitgraph` Underscores in filenames in tests indicate a logical separation - so `commit_graph` becomes `commit::graph`. Rename it to `commitgraph` to avoid this.
Edward Thomson 475c6eba 2022-01-17T17:16:02 win32: improve impl & tests for system path / g4w interop We look for a Git for Windows installation to use its git config, so that clients built on libgit2 can interoperate with the Git for Windows CLI (and clients that are built on top of _it_). Look for `git` both in the `PATH` and in the registry. Use the _first_ git install in the path, and the first git install in the registry. Look in both the `etc` dir and the architecture-specific `etc` dirs (`mingw64/etc` and `mingw32/etc`) beneath the installation root. Prefer the git in the `PATH` to the git location in the registry so that users can override that. Include more tests for this behavior.
Edward Thomson 925abee9 2022-01-15T20:08:10 path: introduce git_fs_path_find_executable Provide a helper function to find an executable in the current process's PATH.
Edward Thomson ecbb01f5 2022-01-17T00:09:13 win32: test system paths for gvfs compatibility
Edward Thomson d298059e 2022-01-17T21:41:12 Merge pull request #6167 from libgit2/ethomson/scp_urls_with_ports Support scp style paths with ports
Edward Thomson 616628dd 2022-01-17T21:39:35 Merge branch 'main' into typos
Edward Thomson e02e6a5c 2022-01-11T10:19:40 url: introduce git_net_str_is_url We occasionally need to determine whether a given string is a URL or something else. (The "something else" may be a git path in a different format, like scp formatting, which needs to be handled differently.)
Edward Thomson e2bda60a 2022-01-10T21:12:13 url: introduce git_net_url_parse_scp Provide a mechanism for parsing scp-style paths (eg `git@github.com:libgit2/libgit2` into the url form `ssh://git@github.com/libgit2/libgit2`.)
Edward Thomson df4448f2 2022-01-10T21:25:05 online: test with https instead of git protocol GitHub is removing support for the unauthenticated git protocol; test with the https protocol.
Peter Pettersson 8d548222 2022-01-14T23:25:27 tests: verify that futils_mktmp respects umask
Edward Thomson adaa037d 2022-01-04T16:18:40 remote: test honoring configuration option Test that we honor `http.followRedirects` when set to initial or false.
Edward Thomson 515daeaf 2022-01-04T06:16:30 remote: introduce `follow_redirects` connect option Give callers the ability to select how to handle redirects - either supporting redirects during the initial connection (so that, for example, `git.example.com/repo` can redirect to `github.com/example/repo`) or all/no redirects. This is for compatibility with git.
Edward Thomson 342e55ac 2021-12-18T10:13:18 url: optionally allow off-site redirects In redirect application logic, (optionally) allow off-site redirects.
Edward Thomson 9faa9199 2022-01-06T07:42:01 status: don't use `// ...` in tests, use `/* ... */`
Edward Thomson ca9f6b98 2022-01-06T07:41:27 Merge remote-tracking branch 'pr/6159'
Edward Thomson da5385c6 2022-01-06T07:39:21 status: don't use `// ...` in tests, use `/* ... */`
Edward Thomson db3572b7 2022-01-06T07:38:07 Merge pull request #6165 from libgit2/ethomson/includeif config: handle empty conditional in includeIf
Dimitris Apostolou 90df4302 2022-01-05T12:18:05 Fix typos
Edward Thomson 83a1e614 2022-01-05T09:18:59 config: handle empty conditional in includeIf When a config file contains `[includeIf]` (with no condition), we should treat that as a falsey value. This means that we should properly parse a config value of `includeIf.path`.
Miguel Arroz a3436cde 2022-01-01T15:17:08 #6154 git_status_list_new case insensitive fix
Miguel Arroz ef848891 2021-12-31T16:40:58 Add `rename_threshold` to `git_status_options`.
punkymaniac 1fa8014a 2021-11-22T12:07:59 Update test for `git_str` usage instead of `git_buf` See commit f0e693b18afbe1de37d7da5b5a8967b6c87d8e53
punkymaniac 8b0ffdcb 2021-11-08T17:23:27 Add test for `git_worktree_add` no checkout
Edward Thomson 942cfac1 2021-12-23T14:21:23 worktree: checkout options suggestions from code review
punkymaniac f9a98f94 2021-11-22T15:16:26 Fix test fail because of memory leak
Edward Thomson a50bbba1 2021-12-23T15:07:29 Merge pull request #6142 from libgit2/ethomson/blob_data_is_binary blob: identify binary content
Edward Thomson 05c3d972 2021-12-23T15:03:08 Merge pull request #6124 from csware/config-parsing Config parsing
Edward Thomson 3cca14b3 2021-12-23T14:13:34 Merge pull request #6125 from stforek/git_commit_summary_spaces git_commit_summary: ignore lines with spaces
Edward Thomson dca31d24 2021-12-23T14:12:23 Merge pull request #6101 from mkhl/fix/instead-of remotes: fix insteadOf/pushInsteadOf handling
Edward Thomson ab5b3f37 2021-12-23T14:09:09 Merge pull request #6095 from yoichi/better-compatiblity-for-at-time-notation Better revparse compatibility for at time notation
Josh Junon c5cd71b2 2021-12-23T18:23:34 cmake: use PROJECT_SOURCE_DIR of CMAKE_SOURCE_DIR Also applies to *_BINARY_DIR. This effectively reverts 84083dcc8bd41332ccac9d7b537f3e254d79011c, which broke all users of libgit2 that use it as a CMake subdirectory (via `add_subdirectory()`). This is because CMAKE_SOURCE_DIR refers to the root-most CMake directory, which in the case of `add_subdirectory()` is a parent project to libgit2 and thus the paths don't make any sense to the configuration files. Corollary, CMAKE_SOURCE_DIR only makes sense if the CMake project is always the root project - which can rarely be guaranteed. In all honesty, CMake should deprecate and eventually remove CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR. It's been the source of headaches and confusion for years, they're rarely useful over CMAKE_CURRENT_(SOURCE|BINARY)_DIR or PROJECT_(SOURCE|BINARY)_DIR, and they cause a lot of confusing configuration and source code layouts to boot. Any time they are used, they break `add_subdirectory()` almost 100% of the time, cause confusing error messages, and hide subtle bugs.
Colin Stolley ad7a51d8 2021-10-07T13:26:52 refs: Speed up packed lookups. Currently ref lookups require loading the entire packed-refs file into a hashmap in memory. For repos with large numbers of refs this can be painfully slow. This patch replaces the existing lookup code and instead mmap()'s the packed-refs file and performs a binary search to locate the ref entry. Git uses a similiar approach. The old hash table codepath is still used for unsorted packed-refs files. This patch also fixes a minor bug where the "peeled" trait is never parsed correctly from the packed-refs header.
Edward Thomson 4591e76a 2021-12-10T15:19:59 blob: identify binary content Introduce `git_blob_data_is_binary` to examine a blob's data, instead of the blob itself. A replacement for `git_buf_is_binary`.
Sven Strickroth dff05bc3 2021-11-25T11:40:20 Multiline config values not preserved on saving (fixes issue #6088) Signed-off-by: Sven Strickroth <email@cs-ware.de>
Sven Strickroth 854164a5 2021-11-25T11:02:41 Add more tests for contents Signed-off-by: Sven Strickroth <email@cs-ware.de>
Sven Strickroth 433edb54 2021-11-25T10:22:22 Config parsing confused by continuations that start with quotes (fixes issue #6089) Signed-off-by: Sven Strickroth <email@cs-ware.de>
Edward Thomson 9f03ebd1 2021-11-29T13:44:42 object: introduce a raw content validation function Users may want to validate raw object content; provide them a function to do so.
Edward Thomson 6fdb1b2f 2021-11-30T21:09:57 Merge pull request #6122 from libgit2/ethomson/cleanup Minor code cleanups
Przemyslaw Ciezkowski 1e015088 2021-11-25T15:19:17 git_commit_summary: ignore lines with spaces Fixes libgit2/libgit2#6065
Yoichi Nakayama 7bb206a7 2021-11-23T10:12:29 Merge branch 'main' into better-compatiblity-for-at-time-notation Conflicts: src/revparse.c
Edward Thomson f9c4dc10 2021-11-22T11:23:50 Merge pull request #6106 from ammgws/fixtemplateerr Fix repo init when template dir is non-existent
Edward Thomson 84083dcc 2021-11-19T08:48:08 cmake: use CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR Instead of using the project-specific `libgit2_SOURCE_DIR` and `libgit2_BINARY_DIR` variables, use `CMAKE_SOURCE_DIR` and `CMAKE_BINARY_DIR`.
Edward Thomson 91365fd8 2021-11-22T09:02:38 sha1: tests should use hashes, not oid computation The tests that examine sha1 behavior (including collision detection) should test against the hash functionality directly, not indirectly using the oid functions.
Edward Thomson fc42c28e 2021-11-19T09:36:03 util: don't include unnecessary system libraries Remove some unnecessary includes from utility code.
Edward Thomson ea62f546 2021-11-14T16:41:11 utf8: include `utf8.h` in tests
Edward Thomson add30a83 2021-11-18T12:36:25 date: rfc2822 formatting uses a `git_buf` instead of a static string
Edward Thomson b2c40314 2021-11-18T12:19:32 date: make it a proper `git_date` utility class Instead of `git__date`, just use `git_date`.
Edward Thomson 4a54d8e3 2021-11-17T07:27:39 cmake: enable testing at the top level 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.
Edward Thomson 86685f8f 2021-11-16T17:10:08 cmake: better explain why headertests exists
Peter Pettersson 7dcc29fc 2021-10-22T22:51:59 Make enum in src,tests and examples C90 compliant by removing trailing comma.
Peter Pettersson 5221e185 2021-10-02T23:54:14 Add target for testing libgit2 headers
Edward Thomson 395b3dc4 2021-11-11T22:10:51 cmake: refactor global variables Update the global variables `LIBGIT2_OBJECTS` to `LIBGIT2_DEPENDENCY_OBJECTS` for clarity and consistency.
Jason Nader bc0d1ad2 2021-11-05T03:08:43 tests: try to init with non-existent template path
Edward Thomson 8d2b3110 2021-11-11T19:58:49 tests: include function declarations
Edward Thomson bfdc0971 2021-11-11T13:32:00 test: correct test names