tests


Log

Author Commit Date CI Message
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
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`.
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
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 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.
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
Edward Thomson ca14942e 2021-11-11T13:28:08 tests: declare functions statically where appropriate
Edward Thomson 3f024b6d 2021-11-11T12:57:44 clar: declare summary functions as static
Edward Thomson 0429894e 2021-11-11T12:28:07 tests: declare trace handler as static
Edward Thomson 49f03c03 2021-11-11T16:53:33 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.
Edward Thomson cf522050 2021-11-11T16:24:37 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.
Edward Thomson d3a7a352 2021-11-06T16:44:07 cmake: move test enablement into test cmake
Martin Kühl 7891660a 2021-10-28T14:15:41 update remote/insteadof tests we want to test: - an anonymous repo (a url) - a named repo with a url - a named repo with a url and pushurl and for each of these matching configuration: - only insteadOf - only pushInsteadOf - both insteadOf and pushInsteadOf this change adds test cases for all of these combinations.
Edward Thomson ceddeed8 2021-11-11T15:20:50 Merge pull request #6104 from libgit2/ethomson/path path: refactor utility path functions
Edward Thomson 1728e27c 2021-11-01T18:19:56 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.
Edward Thomson 315a43b2 2021-11-01T17:37:06 path: introduce `git_path_str_is_valid` Add a `git_str` based validity check; the existing `git_path_is_valid` defers to it.
Edward Thomson 434a4610 2021-11-01T09:31:32 fs_path: `validate` -> `is_valid` Since we're returning a boolean about validation, the name is more properly "is valid".
Edward Thomson 95117d47 2021-10-31T09:45:46 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).
Edward Thomson dd748dbe 2021-11-01T13:04:40 fs_path: make empty component validation optional
Edward Thomson bef02d3e 2021-11-01T10:57:28 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".
Edward Thomson 63e36c53 2021-11-01T09:34:32 path: `validate` -> `is_valid` Since we're returning a boolean about validation, the name is more properly "is valid".
Josh Triplett 94cb060c 2021-11-08T14:54:09 Add tests for ODB refresh Add optional refreshing in the fake backend, and count the number of refresh calls if enabled.
Martin Kühl f66e7f36 2021-10-28T10:25:09 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.
Yoichi Nakayama 6c0d5366 2021-10-22T07:54:12 Cause error when date parsing is failed
Yoichi Nakayama 776a6a8e 2021-10-22T00:09:39 Return the oldest reflog entry on revparse when older time is given For better compatibility with git command which returns the oldest log entry with a warning message.
Yoichi Nakayama 49ebc8a7 2021-10-22T00:08:52 Add a branch with a empty reflog into testrepo.git
Edward Thomson 52693ab4 2021-09-26T23:11:13 cmake: stylistic refactoring Ensure that we always use lowercase function names, and that we do not have spaces preceding open parentheses, for consistency.
Edward Thomson 4e14d4c6 2021-09-26T22:06:49 cmake: BUILD_CLAR is now BUILD_TESTS Nobody knows what CLAR is. The test building option should be `BUILD_TESTS`.
Edward Thomson f0e693b1 2021-09-07T17:53:49 str: introduce `git_str` for internal, `git_buf` is external libgit2 has two distinct requirements that were previously solved by `git_buf`. We require: 1. A general purpose string class that provides a number of utility APIs for manipulating data (eg, concatenating, truncating, etc). 2. A structure that we can use to return strings to callers that they can take ownership of. By using a single class (`git_buf`) for both of these purposes, we have confused the API to the point that refactorings are difficult and reasoning about correctness is also difficult. Move the utility class `git_buf` to be called `git_str`: this represents its general purpose, as an internal string buffer class. The name also is an homage to Junio Hamano ("gitstr"). The public API remains `git_buf`, and has a much smaller footprint. It is generally only used as an "out" param with strict requirements that follow the documentation. (Exceptions exist for some legacy APIs to avoid breaking callers unnecessarily.) Utility functions exist to convert a user-specified `git_buf` to a `git_str` so that we can call internal functions, then converting it back again.
Edward Thomson 31ecaca2 2021-09-30T08:11:40 hash: hash functions operate on byte arrays not git_oids Separate the concerns of the hash functions from the git_oid functions. The git_oid structure will need to understand either SHA1 or SHA256; the hash functions should only deal with the appropriate one of these.
Edward Thomson 2a713da1 2021-09-29T21:31:17 hash: accept the algorithm in inputs
Edward Thomson 8c29885e 2021-09-27T08:57:03 Merge pull request #6076 from libgit2/ethomson/oidarray_dispose oidarray: introduce `git_oidarray_dispose`
Edward Thomson b6449de3 2021-09-27T08:39:55 Merge pull request #6075 from libgit2/ethomson/attr_longpaths
Edward Thomson 853ba203 2021-09-27T08:39:39 Merge pull request #6073 from libgit2/ethomson/attr_lookups
Edward Thomson 7e7cfe8a 2021-09-26T20:20:03 buf: common_prefix takes a string array `git_strarray` is a public-facing type. Change `git_buf_text_common_prefix` to not use it, and just take an array of strings instead.
Edward Thomson 0bd132ab 2021-09-26T17:58:08 oidarray: introduce `git_oidarray_dispose` Since users are disposing the _contents_ of the oidarray, not freeing the oidarray itself, the proper cleanup function is `git_oidarray_dispose`. Deprecate `git_oidarray_free`.
Edward Thomson 46508fe6 2021-09-26T11:28:47 attr_file: don't take the `repo` as an arg The `repo` argument is now unnecessary. Remove it.
Edward Thomson 0f4256b8 2021-09-24T15:23:34 repository: improve `hashfile` for absolute paths When `git_repository_hashfile` is handed an absolute path, it determines whether the path is within the repository's working directory or not. This is necessary when there is no `as_path` specified. If the path is within the working directory, then the given path should be used for attribute lookups (it is the effective `as_path`). If it is not within the working directory, then it is _not_ eligible. Importantly, now we will _never_ pass an absolute path down to attribute lookup functions.
Edward Thomson efa0d64e 2021-09-21T13:19:10 Merge pull request #6067 from libgit2/ethomson/filter_commit_id filter: use a `git_oid` in filter options, not a pointer
Edward Thomson 90656858 2021-09-21T11:28:39 filter: use a `git_oid` in filter options, not a pointer Using a `git_oid *` in filter options was a mistake; it is a deviation from our typical pattern, and callers in some languages that GC may need very special treatment in order to pass both an options structure and a pointer outside of it.
Edward Thomson 470acc71 2021-09-21T11:01:27 rebase: fix (deprecated) signing test
Edward Thomson ba01547d 2021-09-20T21:45:10 Merge pull request #6061 from libgit2/ethomson/email Introduce `git_email_create`; deprecate `git_diff_format_email`
Edward Thomson bfdba8ee 2021-09-20T12:19:48 Merge branch 'sathieu/patch-1' into main
Edward Thomson 8e762124 2021-09-20T12:19:05 httpproxy: move empty string test above config The configuration change will override the environment variable, so the environment variable check needs to come first.
Edward Thomson 005c740b 2021-09-20T14:06:09 win32: ensure content filtering occurs in longpath test
Edward Thomson 482e3853 2021-09-20T14:06:50 Merge remote-tracking branch 'mathworks/longpath_filter_bug' into main
Edward Thomson 0644c2e8 2021-09-20T08:39:46 Merge pull request #6058 from mathworks/proxy_config_with_detached_remote Allow proxy options when connecting with a detached remote.
Edward Thomson ba3595af 2021-09-13T16:25:00 diff: deprecate diff_format_email `git_diff_format_email` is deprecated in favor of `git_email_create`.
Edward Thomson 67b1d019 2021-09-14T09:49:31 email: include renames by default `git format-patch` includes diffs with rename detection enabled by default when creating emails. Match this behavior.
Edward Thomson 323f222f 2021-09-14T09:44:52 email: include binary diffs by default `git format-patch` includes binary diffs by default when creating emails. Match this behavior.
Edward Thomson 3f13d2e8 2021-09-13T10:36:48 email: allow `git_diff_commit_as_email` to take 0 as patch index Allow a `0` patch index and `0` patch count; in this case, simply don't display these in the email.
Edward Thomson 6aa34966 2021-09-13T08:17:21 email: introduce `git_email_create_from_diff` Introduce a function to create an email from a diff and multiple inputs about the source of the diff. Creating an email from a diff requires many more inputs, and should be discouraged in favor of building directly from a commit, and is thus in the `sys` namespace.
Edward Thomson 75d4676a 2021-09-12T17:06:14 email: introduce `git_email_create_from_commit` Create `git_email_*` which will encapsulate email creation and application, and `git_email_create_from_commit` in particular, which creates an email for a single commit.
Laurence McGlashan e994299f 2021-09-16T11:53:32 Update formatting.
Laurence McGlashan eb41276f 2021-09-16T11:44:04 Allow proxy options when connecting with a detached remote.
Colin Stolley 516f7519 2021-09-09T15:08:36 Add test for revert+rename bug.
Laurence McGlashan 0d30e7bb 2021-09-14T13:07:33 Apply suggestions from code review Co-authored-by: Edward Thomson <ethomson@github.com>
Edward Thomson 4f24a932 2021-09-14T07:45:50 Merge pull request #6031 from libgit2/ethomson/extensions Support custom git extensions
Laurence McGlashan 6cf9a0b3 2021-09-14T12:34:45 Refactor shared code in longpath test.
Laurence McGlashan 26bf94c0 2021-09-14T12:19:54 If longpaths is true and filters are enabled, pass git_repository through the filtering code to ensure the cached longpath setting is returned. Fixes: #6054
Mathieu Parent 31e32ddf 2021-09-14T09:34:25 Add test to ensure empty proxy env behaves like unset env Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Basile Henry 5eab4daf 2021-09-09T21:51:52 Add test config parsing This tests parsing a multiline string containing multiple quoted comment chars. See #6019
Edward Thomson a24e656a 2021-09-04T10:16:41 common: support custom repository extensions Allow users to specify additional repository extensions that they want to support. For example, callers can specify that they support `preciousObjects` and then may open repositories that support `extensions.preciousObjects`. Similarly, callers may opt out of supporting extensions that the library itself supports.
Edward Thomson 2f3074da 2021-09-03T17:03:00 repo: refactor extensions tests into their own file
Edward Thomson 3c0f14cc 2021-09-01T20:34:28 remote: refactor proxy detection Update the proxy detection for a remote. 1. Honor `http.<url>.proxy` syntax for a remote's direct URL and parent URLs. 2. Honor an empty configuration URL to override a proxy configuration. Add tests to ensure that configuration specificity is honored.
Edward Thomson 9e98e443 2021-08-31T22:01:34 url: introduce `git_net_url_matches_pattern_list` Provide a utility method on a url to determine if it matches any pattern in a comma-separated list, similar to what one would find in `NO_PROXY` environment variables.