Commit Graph

15 Commits

Author SHA1 Message Date
Edward Thomson
338ceb93b6 Improve documentation 2024-11-26 21:44:09 +00:00
punkymaniac
68bc511abb Add documentation about parameter and return value 2022-01-09 10:17:51 +01:00
punkymaniac
f8b26df34f Add git_apply_options_init documentation 2022-01-09 10:17:50 +01:00
Peter Pettersson
38c3449822 Make enum in includes C90 compliant by removing trailing comma. 2021-11-15 16:45:40 +01:00
punkymaniac
a2fa9a5772 Add some missing documentation about return value 2021-06-02 14:49:33 +02:00
Drew DeVault
02af1fcb69 apply: add GIT_APPLY_CHECK
This adds an option which will check if a diff is applicable without
actually applying it; equivalent to git apply --check.
2019-10-22 10:23:24 -04:00
Etienne Samson
33448b4519 docs: More of it 2019-06-26 15:49:37 +02:00
Etienne Samson
764196fffb doc: add missing documentation comments 2019-06-15 16:15:50 +02:00
Edward Thomson
c0dd7122da apply: add an options struct initializer 2019-06-14 09:57:01 +01:00
Edward Thomson
22d2062d95 Introduce GIT_CALLBACK macro to enforce cdecl
Since we now always build the library with cdecl calling conventions,
our callbacks should be decorated as such so that users will not be able
to provide callbacks defined with other calling conventions.

The `GIT_CALLBACK` macro will inject the `__cdecl` attribute as
appropriate.
2019-01-17 21:17:32 +00:00
Edward Thomson
47cc5f85e9 apply: introduce a hunk callback
Introduce a callback to patch application that allows consumers to
cancel hunk application.
2018-11-05 15:53:59 +00:00
Edward Thomson
af33210b73 apply: introduce a delta callback
Introduce a callback to the application options that allow callers to
add a per-delta callback.  The callback can return an error code to stop
patch application, or can return a value to skip the application of a
particular delta.
2018-11-05 15:53:59 +00:00
Edward Thomson
37b25ac57f apply: move location to an argument, not the opts
Move the location option to an argument, out of the options structure.
This allows the options structure to be re-used for functions that don't
need to know the location, since it's implicit in their functionality.
For example, `git_apply_tree` should not take a location, but is
expected to take all the other options.
2018-11-05 15:53:58 +00:00
Edward Thomson
f83bbe0a88 apply: introduce git_apply
Introduce `git_apply`, which will take a `git_diff` and apply it to the
working directory (akin to `git apply`), the index (akin to `git apply
--cached`), or both (akin to `git apply --index`).
2018-11-04 09:21:48 +00:00
Edward Thomson
02b1083ab7 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.
2018-11-03 16:44:26 +00:00