summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* refactor: move headertest into separate test folderEdward Thomson2022-02-225-17/+18
|
* refactor: move clar into separate directoryEdward Thomson2022-02-2218-13/+16
|
* refactor: `tests` is now `tests/libgit2`Edward Thomson2022-02-22486-115/+145
| | | | | | 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.
* cmake: document CMakeLists.txt hierarchyEdward Thomson2022-02-221-0/+2
|
* Merge pull request #6228 from libgit2/ethomson/win32_systemdirsEdward Thomson2022-02-221-0/+10
|\ | | | | win32: `find_system_dirs` does not return `GIT_ENOTFOUND`
| * win32: `find_system_dirs` does not return `GIT_ENOTFOUND`Edward Thomson2022-02-211-0/+10
| | | | | | | | | | | | | | | | 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.
* | test: add test for the behaviour of update_tips on errorCarlos Martín Nieto2022-02-211-0/+41
|/
* diff_file: test empty workdir file grows after obtaining a diffEdward Thomson2022-02-111-1/+28
| | | | | This test was also provided by @jorio https://github.com/libgit2/libgit2/pull/6208#issuecomment-1034072050
* diff_file: test workdir file becomes empty after obtaining a diffIliyas Jorio2022-02-111-0/+29
|
* diff_file: fix crash if size of diffed file changes in workdirIliyas Jorio2022-02-111-0/+77
| | | | | | | | | | | | | "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.
* Merge pull request #6203 from libgit2/ethomson/fetch_by_oidEdward Thomson2022-02-113-0/+107
|\ | | | | Fetch by object id
| * fetch: support oids in fetch specsEdward Thomson2022-02-062-0/+62
| |
| * fetch: add a test for local fetchingEdward Thomson2022-02-061-0/+36
| |
| * oid: introduce git_oid__is_hexstrEdward Thomson2022-02-051-0/+9
| | | | | | | | | | Introduce a function that determines whether a given string is a valid object id (40 chars of hexadigits).
* | Merge pull request #6192 from libgit2/ethomson/sha256_preparationEdward Thomson2022-02-065-26/+23
|\ \ | |/ |/| SHA256: early preparation
| * packbuilder: use the packfile name instead of hashEdward Thomson2022-01-272-8/+4
| | | | | | | | | | Deprecate the `git_packfile_hash` function. Callers should use the new `git_packfile_name` function which provides a unique packfile name.
| * indexer: use a byte array for checksumEdward Thomson2022-01-272-9/+7
| | | | | | | | | | | | | | | | 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.
| * index: use a byte array for checksumEdward Thomson2022-01-271-6/+9
| | | | | | | | | | | | | | | | | | | | | | 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.
| * commit_graph: tests are now `commitgraph`Edward Thomson2022-01-271-3/+3
| | | | | | | | | | | | Underscores in filenames in tests indicate a logical separation - so `commit_graph` becomes `commit::graph`. Rename it to `commitgraph` to avoid this.
* | Merge pull request #6196 from libgit2/ethomson/at_revparseEdward Thomson2022-02-031-0/+7
|\ \ | | | | | | revparse: support bare '@'
| * | revparse: support bare '@'Edward Thomson2022-01-301-0/+7
| | | | | | | | | | | | A bare '@' revision syntax represents HEAD. Support it as such.
* | | Merge pull request #6197 from libgit2/ethomson/merge_msg_conflict_commentEdward Thomson2022-02-023-11/+11
|\ \ \ | | | | | | | | merge: comment conflicts lines in MERGE_MSG
| * | | merge: comment conflicts lines in MERGE_MSGEdward Thomson2022-01-303-11/+11
| |/ / | | | | | | | | | | | | git has started adding comment markers to its conflict lines in MERGE_MSG. Match that behavior.
* | | Merge pull request #6195 from libgit2/ethomson/zdiff3Edward Thomson2022-02-023-0/+126
|\ \ \ | |/ / |/| | merge: support zdiff3 conflict styles
| * | merge: support zdiff3 conflict stylesEdward Thomson2022-01-303-0/+126
| |/
* | Merge branch 'boretrk/futils_mktmp'Edward Thomson2022-01-301-0/+26
|\ \
| * | tests: verify that futils_mktmp respects umaskPeter Pettersson2022-01-141-0/+26
| | |
* | | Merge pull request #6138 from ccstolley/ccs_packedrefs_fastEdward Thomson2022-01-305-4/+28
|\ \ \ | |_|/ |/| | refs: Speed up packed lookups.
| * | refs: Speed up packed lookups.Colin Stolley2021-12-145-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | win32: improve impl & tests for system path / g4w interopethomson/win32_findfile_fixesEdward Thomson2022-01-172-91/+328
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | path: introduce git_fs_path_find_executableEdward Thomson2022-01-171-0/+86
| | | | | | | | | | | | | | | Provide a helper function to find an executable in the current process's PATH.
* | | win32: test system paths for gvfs compatibilityEdward Thomson2022-01-171-0/+91
| | |
* | | Merge pull request #6167 from libgit2/ethomson/scp_urls_with_portsEdward Thomson2022-01-177-52/+381
|\ \ \ | | | | | | | | Support scp style paths with ports
| * | | url: introduce git_net_str_is_urlEdward Thomson2022-01-171-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | 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.)
| * | | url: introduce git_net_url_parse_scpEdward Thomson2022-01-171-0/+321
| | | | | | | | | | | | | | | | | | | | | | | | Provide a mechanism for parsing scp-style paths (eg `git@github.com:libgit2/libgit2` into the url form `ssh://git@github.com/libgit2/libgit2`.)
| * | | online: test with https instead of git protocolEdward Thomson2022-01-175-52/+43
| | | | | | | | | | | | | | | | | | | | GitHub is removing support for the unauthenticated git protocol; test with the https protocol.
* | | | Merge branch 'main' into typosEdward Thomson2022-01-179-31/+312
|\ \ \ \ | |/ / /
| * | | remote: test honoring configuration optionEdward Thomson2022-01-131-9/+57
| | | | | | | | | | | | | | | | Test that we honor `http.followRedirects` when set to initial or false.
| * | | remote: introduce `follow_redirects` connect optionEdward Thomson2022-01-131-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | url: optionally allow off-site redirectsEdward Thomson2022-01-131-22/+40
| | |/ | |/| | | | | | | In redirect application logic, (optionally) allow off-site redirects.
| * | status: don't use `// ...` in tests, use `/* ... */`Edward Thomson2022-01-061-5/+4
| | |
| * | Merge remote-tracking branch 'pr/6159'Edward Thomson2022-01-065-0/+64
| |\ \
| | * | #6154 git_status_list_new case insensitive fixMiguel Arroz2022-01-015-0/+63
| | | |
| * | | status: don't use `// ...` in tests, use `/* ... */`Edward Thomson2022-01-061-15/+15
| | | |
| * | | Merge pull request #6165 from libgit2/ethomson/includeifEdward Thomson2022-01-061-0/+25
| |\ \ \ | | | | | | | | | | config: handle empty conditional in includeIf
| | * | | config: handle empty conditional in includeIfEdward Thomson2022-01-051-0/+25
| | |/ / | | | | | | | | | | | | | | | | | | | | 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`.
| * | | Add `rename_threshold` to `git_status_options`.Miguel Arroz2021-12-311-0/+63
| |/ /
* | | Fix typosDimitris Apostolou2022-01-0516-26/+26
|/ /
* | worktree: checkout options suggestions from code reviewEdward Thomson2021-12-231-1/+1
| |
* | Fix test fail because of memory leakpunkymaniac2021-12-231-0/+1
| |