tests


Log

Author Commit Date CI Message
Edward Thomson 433a1334 2022-07-13T21:08:04 Merge pull request #6191 from libgit2/ethomson/sha256_poc RFC: SHA256 proof of concept
Edward Thomson 3c8a860d 2022-07-13T10:19:14 Merge pull request #6348 from lya001/fix-invalid-branch-name Fix creation of branches and tags with invalid names
Edward Thomson b70dbaa2 2022-07-12T22:12:36 Merge pull request #6347 from libgit2/ethomson/no_pack_v3 pack: don't pretend we support pack files v3
yuangli 760a5acc 2022-07-12T15:07:54 Merge branch 'main' into fix-invalid-branch-name
yuangli 1912f145 2022-07-11T15:53:35 tests: free resources in invalid tag name test
yuangli 7456e819 2022-07-11T15:42:16 tests: error when create tag with invalid name
yuangli 724b5a0e 2022-07-11T15:24:34 tests: rename to follow clar naming convention
yuangli 2e9228e8 2022-07-11T15:23:41 tests: rename test for consistency
yuangli 71fafae1 2022-07-11T12:03:37 tests: error when create branch with invalid name
yuangli e4f98ac4 2022-07-11T12:00:23 tests: follow clar naming convention
Edward Thomson 4597b869 2022-07-08T21:28:15 pack: don't pretend we support pack files v3 Pack files v3 are introduced in the SHA256 hash transition document https://github.com/git/git/blob/master/Documentation/technical/hash-function-transition.txt Obviously we do not support these yet. Stop pretending that we do.
Edward Thomson 56aaaf53 2022-07-04T16:03:10 repo: allow admin owned configs by admin users Allow users in the administrator group to use git configs that are owned by administrators.
Edward Thomson df354ec2 2022-07-03T09:07:32 fs: remove mock naming from change ownership constants 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.
Edward Thomson 78af6b5e 2022-07-02T15:21:55 repo: add tests for bare repo permissions Ensure that we test opening a bare repository with odd permissions.
Edward Thomson f51f6646 2022-07-02T15:36:07 Revert "repo: allow administrator to own the configuration" This reverts commit cdff2f0237f663e0f68155655a8b66d05c1ec716. This change erroneously allowed system users to own a worktree; this should only be allowed when the current user is in the Administrator group on Windows as well.
Edward Thomson 6c57bac6 2022-06-14T22:29:10 sha256: make sha256 an experimental optional feature 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.
Edward Thomson 04f34688 2022-01-26T13:10:01 odb_loose: SHA256 support for loose object storage Teach the loose object database how to cope with SHA256 objects.
Edward Thomson 162c996b 2022-01-25T13:43:02 oid: add git_oid_fmt_substr Tidy up `nfmt` / `pathfmt`.
Edward Thomson 4d7ec76c 2021-12-12T09:19:25 odb: add git_odb_loose_backend_options Move the arguments to `git_odb_loose` into an options structure.
Edward Thomson 3eba9181 2022-01-26T13:02:49 odb: add git_odb_options Users will need to be able to specify the object id type for the given object database; add a new `git_odb_options` with that option.
Edward Thomson 81732413 2022-01-27T15:02:27 clar: format sha256 in cl_assert_equal_oid
Edward Thomson 0db1c57c 2022-01-25T10:32:47 oid: add sha256 typed oids
Edward Thomson 3fbf580c 2022-01-23T09:47:01 oid: give oids a type `git_oid`s now have a type, and we require the oid type when creating the object id from creation functions.
Edward Thomson 8444b6dc 2022-01-26T13:07:28 odb_hash*: accept the oid type to hash into The git_odb_hash helper functions should not assume SHA1, and instead should be given the oid type that they're producing.
Edward Thomson 61838295 2022-01-26T16:22:04 object: move oid header printing to object
Edward Thomson b7a46fa8 2022-01-23T12:25:03 object: move oid header parsing to object
Edward Thomson 0acaf3a8 2022-01-17T13:40:37 oid: define GIT_OID_SHA1_ZERO Callers should not assume the layout of the oid structure; provide them a macro that defines the null / zero sha1 object id.
Edward Thomson dbc4ac1c 2022-01-22T23:10:03 oid: `GIT_OID_*SZ` is now `GIT_OID_SHA1_*SIZE` In preparation for SHA256 support, `GIT_OID_RAWSZ` and `GIT_OID_HEXSZ` need to indicate that they're the size of _SHA1_ OIDs.
Edward Thomson cdff2f02 2022-06-13T21:34:01 repo: allow administrator to own the configuration Update our ownership checks that were introduced in libgit2 v1.4.3 (to combat CVE 2022-24765). These were not compatible with git's; git itself allows administrators to own the path. Our checks now match this behavior.
lhchavez 0a7c00be 2022-06-11T14:31:16 Merge remote-tracking branch 'origin/main' into main
lhchavez a7541676 2022-06-11T14:29:15 Apply suggestions from code review Co-authored-by: Edward Thomson <ethomson@github.com>
Carl Dong 7f53d7b6 2022-05-09T12:09:08 revparse: Remove error-prone, redundant test Originally introduced in: 776a6a8e5f8e258d31aded73c0ce38df6ac7bdc4 This test case has recently been fixed in bdab22384cc61d315005a65456a9f9563bb27c8f, but that fix will only last for a year. Next year the same problem will crop up and the test will need to be re-edited. This is not ideal as - This test case becomes an unnecessary burden for developers - Downstream distros or even just users who want to build older versions of libgit2 are guaranteed to have this test fail Furthermore, this test case is entirely unnecessary, as the functionality that was originally (see 776a6a8e5f8e258d31aded73c0ce38df6ac7bdc4) intended to be tested is well-covered by subsequent tests which specify a date instead of a "x ago" specification.
Carlos Martín Nieto bdab2238 2022-05-03T09:28:43 revparse: adjust reflog test as we move away from the dates The dates we use in `refs::revparse::date` has just passed the ten years, so now everything is beyond ten years, leading to an unexpected commit being returned. Adjust it to 11 years so it all looks fine again.
Edward Thomson 3b52e5f5 2022-04-18T17:12:27 Merge pull request #6265 from libgit2/ethomson/sha256_two sha256: refactoring in preparation for sha256
lhchavez 1d88605c 2022-04-16T08:19:38 transport: introduce `git_transport_smart_remote_connect_options` 6fc6eeb66c40310086c8f059cae41de69ad4c6da removed `git_transport_smart_proxy_option`, and there was nothing added to replace it. That made it hard for custom transports / smart subtransports to know what remote connect options to use (e.g. proxy options). This change introduces `git_transport_smart_remote_connect_options` to replace it.
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 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 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 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 7367a9d5 2022-01-22T09:07:26 tests: don't cast raw data to a `git_oid`` Create an object id from raw data instead of casting.
Edward Thomson 590ff981 2022-01-21T19:49:09 oid: don't assume the size of an oid Don't assume that a `git_oid` is a particular size; allocate `sizeof(git_oid)` instead.
Edward Thomson ab042161 2022-01-18T08:12:18 tree: move git_oid into tree entry A tree entry previously pointed directly into the object id within the tree object itself; this is useful to avoid any unnecessary memory copy (and an unnecessary use of 40 bytes per tree entry) but difficult if we change the underlying `git_oid` object to not simply be a raw object id but have additional structure. This commit moves the `git_oid` directly into the tree entry; this simplifies the tree entry creation from user data. We now copy the `git_oid` into place when parsing.
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
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 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
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