tests/apply


Log

Author Commit Date CI Message
Edward Thomson 9d81defa 2018-06-28T16:26:08 apply tests: GIT_APPLY_LOCATION_INDEX with parsed patches
Edward Thomson eef34e4e 2018-06-28T16:24:21 apply tests: GIT_APPLY_LOCATION_INDEX with generated patches Test a simple patch application with `GIT_APPLY_LOCATION_INDEX`, which emulates `git apply --cached`.
Edward Thomson 35d525b0 2018-06-26T09:19:12 apply: test that failures don't dirty workdir Ensure that when a patch application fails (due to a conflict in the working directory, for example) that we do not half-apply the patch or otherwise leave the working directory dirty. This is rather obvious in our current apply implementation (we do a two step process: one to create the post-image and one to check it out) but this test is a safety net for future refactoring or improvements.
Edward Thomson 0eb63b9f 2018-06-25T19:50:35 apply tests: separate common patch hunks Move the commonly-used patch hunks into a single constant location. This allows us to avoid re-declaring them in each test, and allows us to compose them to build a larger patch file that includes all the hunks.
Edward Thomson 702d4bec 2018-06-26T15:26:37 apply tests: use `git_iterator_foreach` for tests Use the new `git_iterator_foreach` API to validate the workdir against the expected workdir values instead of using the paired/multi iterator comparison callback. This allows us to use the `git_iterator_foreach` to validate the index as well, instead of assuming that the index and HEAD must always match.
Edward Thomson 9c34c996 2018-06-25T17:03:14 apply: handle file additions Don't attempt to read the postimage file during a file addition, simply use an empty buffer as the postimage. Also, test that we can handle file additions.
Edward Thomson c010c93b 2018-06-27T16:50:07 apply tests: move helpers into common area
Edward Thomson 973bf0c8 2018-06-25T20:49:22 apply: test a patch can be applied even with a modified index Ensure that we can apply a patch to the working directory, even to files that are modified in the index (as long as the working directory contents match the preimage - such that the working directory is unmodified from HEAD).
Edward Thomson 3b5378c5 2018-06-25T16:27:06 apply: handle file deletions If the file was deleted in the postimage, do not attempt to update the target. Instead, ignore it and simply allow it to stay removed in our computed postimage. Also, test that we can handle file deletions.
Edward Thomson af3287f8 2018-06-22T19:27:19 apply: test `git_apply` with a parsed patch Ensure that we can apply a simple patch to the working directory when we have parsed it from a patch file.
Edward Thomson 553395dc 2018-06-25T20:21:01 apply: test that the index is not modified Ensure that by default, when using GIT_APPLY_LOCATION_WORKDIR, that patch application does not update the index, only the working directory.
Edward Thomson ff296b71 2018-03-19T19:50:52 apply: test `git_apply` application to a workdir Introduce a standard test applying a diff to a working directory with no complications.
Edward Thomson 02b1083a 2018-01-28T23:25:07 apply: introduce `git_apply_tree` Introduce `git_apply_tree`, which will apply a `git_diff` to a given `git_tree`, allowing an in-memory patch application for a repository.
Patrick Steinhardt ecf4f33a 2018-02-08T11:14:48 Convert usage of `git_buf_free` to new `git_buf_dispose`
Edward Thomson 17572f67 2016-04-21T00:04:14 git_patch_parse_ctx: refcount the context
Edward Thomson 440e3bae 2015-11-21T12:27:03 patch: `git_patch_from_patchfile` -> `git_patch_from_buffer`
Edward Thomson 0ff723cc 2015-09-25T12:09:50 apply: test postimages that grow/shrink original Test with some postimages that actually grow/shrink from the original, adding new lines or removing them. (Also do so without context to ensure that we can add/remove from a non-zero part of the line vector.)
Edward Thomson 82175084 2015-09-23T13:40:12 Introduce git_patch_options, handle prefixes Handle prefixes (in terms of number of path components) for patch parsing.
Edward Thomson 8bca8b9e 2015-09-16T14:40:44 apply: move patch data to patch_common.h
Edward Thomson 804d5fe9 2015-09-11T08:37:12 patch: abstract patches into diff'ed and parsed Patches can now come from a variety of sources - either internally generated (from diffing two commits) or as the results of parsing some external data.
Edward Thomson 8d2eef27 2015-07-10T09:09:27 patch parsing: ensure empty patches are illegal
Edward Thomson 5d17d726 2015-07-09T19:22:28 patch parsing: parse binary patch files
Edward Thomson 3149ff6f 2015-06-17T18:13:10 patch application: apply binary patches Handle the application of binary patches. Include tests that produce a binary patch (an in-memory `git_patch` object), then enusre that the patch applies correctly.
Edward Thomson 0004386f 2015-06-17T06:03:01 apply: handle empty patches When a patch is empty, simply copy the source into the destination.
Edward Thomson d34f6826 2014-04-08T17:18:47 Patch parsing from patch files
Edward Thomson 7cb904ba 2014-04-01T23:58:59 Introduce git_apply_patch The beginnings of patch application from an existing (diff-created) git_patch object: applies the hunks of a git_patch to a buffer.