summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
| * config::write::repeated: init our bufferEdward Thomson2016-03-281-1/+1
| |
| * config: show we write a spurious duplicated section headerCarlos Martín Nieto2016-03-281-0/+24
| | | | | | | | | | We should notice that we are in the correct section to add. This is a cosmetic bug, since replacing any of these settings does work.
* | Merge pull request #3703 from libgit2/cmn/multivar-set-lockedEdward Thomson2016-03-281-1/+1
|\ \ | |/ |/| config: don't special-case multivars that don't exist yet
| * config: don't special-case multivars that don't exist yetcmn/multivar-set-lockedCarlos Martín Nieto2016-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | This special-casing ignores that we might have a locked file, so the hashtable does not represent the contents of the file we want to write. This causes multivar writes to overwrite entries instead of add to them when under lock. There is no need for this as the normal code-path will write to the file just fine, so simply get rid of it.
* | iterator: new workdir-iterator test for pathlist + includings treesMarc Strapetz2016-03-241-0/+26
| |
* | iterator: new index-iterator test for pathlist + includings treesMarc Strapetz2016-03-241-0/+31
| |
* | iterator: more pathlist-related tests should test actual pathsMarc Strapetz2016-03-242-6/+23
| |
* | iterator: don't run the gunk test by default on CIEdward Thomson2016-03-241-1/+1
| | | | | | | | (It's slow!)
* | iterator: refactor index iteratorEdward Thomson2016-03-244-58/+688
| |
* | Introduce `git_path_common_dirlen`Edward Thomson2016-03-241-0/+20
| |
* | iterator: give the tests a proper hierarchyEdward Thomson2016-03-247-3332/+3375
| | | | | | | | | | | | Iterator tests were split over repo::iterator and diff::iterator, with duplication between the two. Move them to iterator::index, iterator::tree, and iterator::workdir.
* | Added clar test for #3568Jeff Hostetler2016-03-231-0/+129
| |
* | iterator: test that we can `advance_into` empty dirsEdward Thomson2016-03-231-0/+59
| | | | | | | | | | | | Prior iterator implementations returned `GIT_ENOTFOUND` when trying to advance into empty directories. Ensure that we no longer do that and simply handle them gracefully.
* | Failing test.joshaber2016-03-231-10/+53
| |
* | iterator: test pathlist handling for directoriesMarc Strapetz2016-03-232-0/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | tree_iterator was only working properly for a pathlist containing file paths. In case of directory paths, it didn't match children which contradicts GIT_DIFF_DISABLE_PATHSPEC_MATCH and is different from index_iterator and fs_iterator. As a consequence head-to-index status reporting for a specific directory did not work properly -- all files have been reported as added. Include additional tests.
* | iterator: test `advance_over` with a pathlistEdward Thomson2016-03-231-0/+60
| |
* | iterator: add tests for advance_overEdward Thomson2016-03-231-0/+77
| | | | | | | | | | `git_iterator_advance_over` is a gnarly bit of code with no actual tests.
* | iterator: test workdir pathlist with deep pathsEdward Thomson2016-03-231-0/+159
| | | | | | | | | | | | | | | | In the workdir iterator we do some tricky things to step down into directories to look for things that are in our pathlist. Make sure that we don't confuse between folders that we're definitely going to return everything in and folders that we're only stepping down into to keep looking for matches.
* | iterator: workdir tests with submodulesEdward Thomson2016-03-231-0/+80
| | | | | | | | | | Ensure that when specifying start/end paths, or pathlists, that we deal correctly with submodules.
* | iterator: expand workdir tests with pathlistEdward Thomson2016-03-231-62/+224
| | | | | | | | | | Expand the workdir tests to validate the paths in case sensitive and insensitive tests.
* | iterator: test that we're at the end of iterationEdward Thomson2016-03-231-0/+13
| | | | | | | | | | | | | | Ensure that we have hit the end of iteration; previously we tested that we saw all the values that we expected to see. We did not then ensure that we were at the end of the iteration (and that there were subsequently values in the iteration that we did *not* expect.)
* | iterator: test fs iterator w/ many nested empty dirsEdward Thomson2016-03-231-0/+30
| |
* | iterator: skip unreadable directories in fs iteratorEdward Thomson2016-03-231-3/+9
| | | | | | | | | | Do not abort iteration in the middle when encountering an unreadable directory. Instead, skip it, as if it didn't exist.
* | iterators: refactored tree iteratorEdward Thomson2016-03-232-11/+4
| | | | | | | | | | | | | | | | Refactored the tree iterator to never recurse; simply process the next entry in order in `advance`. Additionally, reduce the number of allocations and sorting as much as possible to provide a ~30% speedup on case-sensitive iteration. (The gains for case-insensitive iteration are less majestic.)
* | repo::iterator: don't go out of boundsEdward Thomson2016-03-231-2/+2
| |
* | iterator: disambiguate reset and reset_rangeEdward Thomson2016-03-232-3/+3
| | | | | | | | | | | | Disambiguate the reset and reset_range functions. Now reset_range with a NULL path will clear the start or end; reset will leave the existing start and end unchanged.
* | status: update test to include valid OIDEdward Thomson2016-03-231-1/+1
| |
* | Merge pull request #3704 from ethomson/tree-reuseCarlos Martín Nieto2016-03-231-0/+55
|\ \ | | | | | | tree: drop the now-unnecessary entries vector
| * | tree: drop the now-unnecessary entries vectorEdward Thomson2016-03-221-0/+55
| | | | | | | | | | | | | | | Remove the now-unnecessary entries vector. Add `git_array_search` to binary search through an array to accomplish this.
* | | blob: remove _fromchunks()cmn/createblob-streamCarlos Martín Nieto2016-03-221-156/+0
| | | | | | | | | | | | | | | | | | The callback mechanism makes it awkward to write data from an IO source; move to `_fromstream()` which lets the caller remain in control, in the same vein as we prefer iterators over foreach callbacks.
* | | blob: fix fromchunks iteration counterCarlos Martín Nieto2016-03-222-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | By returning when the count goes to zero rather than below it, setting `howmany` to 7 in fact writes out the string 6 times. Correct the termination condition to write out the string the amount of times we specify.
* | | blob: introduce creating a blob by writing into a streamCarlos Martín Nieto2016-03-221-0/+103
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pair of `git_blob_create_frombuffer()` and `git_blob_create_frombuffer_commit()` is meant to replace `git_blob_create_fromchunks()` by providing a way for a user to write a new blob when they want filtering or they do not know the size. This approach allows the caller to retain control over when to add data to this buffer and a more natural fit into higher-level language's own stream abstractions instead of having to handle IO wait in the callback. The in-memory buffer size of 2MB is chosen somewhat arbitrarily to be a round multiple of usual page sizes and a value where most blobs seem likely to be either going to be way below or way over that size. It's also a round number of pages. This implementation re-uses the helper we have from `_fromchunks()` so we end up writing everything to disk, but hopefully more efficiently than with a default filebuf. A later optimisation can be to avoid writing the in-memory contents to disk, with some extra complexity.
* | tree: re-use the id and filename in the odb objectCarlos Martín Nieto2016-03-202-1/+3
|/ | | | | Instead of copying over the data into the individual entries, point to the originals, which are already in a format we can use.
* merge drivers: handle configured but not found driverEdward Thomson2016-03-171-0/+18
|
* merge driver: remove `check` callbackEdward Thomson2016-03-171-124/+7
| | | | | | Since the `apply` callback can defer, the `check` callback is not necessary. Removing the `check` callback further makes the `payload` unnecessary along with the `cleanup` callback.
* merge driver: tests for set and unset merge attributeEdward Thomson2016-03-171-1/+36
| | | | | | | Ensure that setting the merge attribute forces the built-in default `text` driver and does *not* honor the `merge.default` configuration option. Further ensure that unsetting the merge attribute forces a conflict (the `binary` driver).
* merge driver: tests for custom default merge driversEdward Thomson2016-03-171-0/+59
|
* merge driver: test GIT_EMERGECONFLICTEdward Thomson2016-03-171-0/+90
| | | | | When a `check` or `apply` callback function returns `GIT_EMERGECONFLICT` stop and product a conflict.
* merge driver: test GIT_PASSTHROUGHEdward Thomson2016-03-171-0/+95
| | | | | When a `check` or `apply` callback function returns `GIT_PASSTHROUGH`, move on to the default merge driver.
* merge driver: introduce custom merge driversEdward Thomson2016-03-171-0/+208
| | | | | | | | Consumers can now register custom merged drivers with `git_merge_driver_register`. This allows consumers to support the merge drivers, as configured in `.gitattributes`. Consumers will be asked to perform the file-level merge when a custom driver is configured.
* Fix rebase bug and include test for merge=unionStan Hu2016-03-171-0/+36
|
* Merge pull request #3673 from libgit2/cmn/commit-with-signatureEdward Thomson2016-03-171-0/+100
|\ | | | | commit: add function to attach a signature to a commit
| * commit: add function to attach a signature to a commitcmn/commit-with-signatureCarlos Martín Nieto2016-03-151-0/+100
| | | | | | | | | | In combination with the function which creates a commit into a buffer, this allows us to more easily create signed commits.
* | Merge pull request #3685 from pks-t/pks/memleaksEdward Thomson2016-03-172-20/+19
|\ \ | | | | | | Test memleaks
| * | tests: transport: fix memory leaks with registering transportsPatrick Steinhardt2016-03-111-18/+17
| | |
| * | tests: nsec: correctly free nsec_pathPatrick Steinhardt2016-03-111-2/+2
| |/ | | | | | | | | | | git_buf_clear does not free allocated memory associated with a git_buf. Use `git_buf_free` instead to correctly free its memory and plug the memory leak.
* | commit: fix extraction of single-line signaturescmn/extract-oneline-sigCarlos Martín Nieto2016-03-171-0/+24
| | | | | | | | | | | | | | | | The function to extract signatures suffers from a similar bug to the header field finding one by having an unecessary line feed check as a break condition of its loop. Fix that and add a test for this single-line signature situation.
* | Use general cl_git_fail because the error is genericDirkjan Bussink2016-03-141-2/+1
| |
* | Setup better defaults for OpenSSL ciphersDirkjan Bussink2016-03-141-0/+9
|/ | | | | | | | | This ensures that when using OpenSSL a safe default set of ciphers is selected. This is done so that the client communicates securely and we don't accidentally enable unsafe ciphers like RC4, or even worse some old export ciphers. Implements the first part of https://github.com/libgit2/libgit2/issues/3682
* Merge pull request #3623 from ethomson/rebase_with_commitCarlos Martín Nieto2016-03-093-5/+288
|\ | | | | rebase: additional setup tests of exotic behavior