|
1 | 1 | (** |
2 | 2 | * @file git2/apply.h |
3 | | - * @brief Git patch application routines |
| 3 | + * @brief Apply patches to the working directory or index |
4 | 4 | * @defgroup git_apply Git patch application routines |
5 | 5 | * @ingroup Git |
| 6 | + * |
| 7 | + * Mechanisms to apply a patch to the index, the working directory, |
| 8 | + * or both. |
6 | 9 | * @{ |
7 | 10 | *) |
8 | 11 |
|
|
42 | 45 | type |
43 | 46 | git_apply_hunk_cb = function(hunk: Pgit_diff_hunk; payload: Pointer): Integer; cdecl; |
44 | 47 |
|
45 | | - (** Flags controlling the behavior of git_apply *) |
| 48 | + (** |
| 49 | + * Flags controlling the behavior of `git_apply`. |
| 50 | + * |
| 51 | + * When the callback: |
| 52 | + * - returns < 0, the apply process will be aborted. |
| 53 | + * - returns > 0, the hunk will not be applied, but the apply process |
| 54 | + * continues |
| 55 | + * - returns 0, the hunk is applied, and the apply process continues. |
| 56 | + *) |
46 | 57 |
|
47 | 58 | const |
48 | 59 | (** |
|
54 | 65 | git_apply_flags_t = Integer; |
55 | 66 |
|
56 | 67 | (** |
57 | | - * Apply options structure |
58 | | - * |
59 | | - * Initialize with `GIT_APPLY_OPTIONS_INIT`. Alternatively, you can |
60 | | - * use `git_apply_options_init`. |
61 | | - * |
62 | | - * @see git_apply_to_tree, git_apply |
63 | | - *) |
| 68 | + * Apply options structure. |
| 69 | + * |
| 70 | + * When the callback: |
| 71 | + * - returns < 0, the apply process will be aborted. |
| 72 | + * - returns > 0, the hunk will not be applied, but the apply process |
| 73 | + * continues |
| 74 | + * - returns 0, the hunk is applied, and the apply process continues. |
| 75 | + * |
| 76 | + * Initialize with `GIT_APPLY_OPTIONS_INIT`. Alternatively, you can |
| 77 | + * use `git_apply_options_init`. |
| 78 | + * |
| 79 | + * @see git_apply_to_tree |
| 80 | + * @see git_apply |
| 81 | + *) |
64 | 82 |
|
65 | 83 | git_apply_options = record |
66 | 84 | version: Cardinal; (**< The version *) |
67 | 85 | (** When applying a patch, callback that will be made per delta (file). *) |
68 | 86 | delta_cb: git_apply_delta_cb; |
69 | 87 | (** When applying a patch, callback that will be made per hunk. *) |
70 | 88 | hunk_cb: git_apply_hunk_cb; |
71 | | - (** Payload passed to both delta_cb & hunk_cb. *) |
| 89 | + (** Payload passed to both `delta_cb` & `hunk_cb`. *) |
72 | 90 | payload: Pointer; |
73 | | - (** Bitmask of git_apply_flags_t *) |
| 91 | + (** Bitmask of `git_apply_flags_t` *) |
74 | 92 | flags: Cardinal; |
75 | 93 | end; |
76 | 94 | Pgit_apply_options = ^git_apply_options; |
77 | 95 |
|
78 | 96 | const |
| 97 | + (** Current version for the `git_apply_options` structure *) |
79 | 98 | GIT_APPLY_OPTIONS_VERSION = 1; |
| 99 | + (** Static constructor for `git_apply_options` *) |
80 | 100 | //GIT_APPLY_OPTIONS_INIT = { GIT_APPLY_OPTIONS_VERSION }; |
81 | 101 |
|
82 | | -(** |
83 | | - * Initialize git_apply_options structure |
84 | | - * |
85 | | - * Initialize a `git_apply_options` with default values. Equivalent to creating |
86 | | - * an instance with GIT_APPLY_OPTIONS_INIT. |
87 | | - * |
88 | | - * @param opts The `git_apply_options` struct to initialize. |
89 | | - * @param version The struct version; pass `GIT_APPLY_OPTIONS_VERSION` |
90 | | - * @return 0 on success or -1 on failure. |
91 | | - *) |
| 102 | + (** |
| 103 | + * Initialize git_apply_options structure |
| 104 | + * |
| 105 | + * Initialize a `git_apply_options` with default values. Equivalent to creating |
| 106 | + * an instance with GIT_APPLY_OPTIONS_INIT. |
| 107 | + * |
| 108 | + * @param opts The `git_apply_options` struct to initialize. |
| 109 | + * @param version The struct version; pass `GIT_APPLY_OPTIONS_VERSION` |
| 110 | + * @return 0 on success or -1 on failure. |
| 111 | + *) |
92 | 112 |
|
93 | 113 | function git_apply_options_init(opts: Pgit_apply_options; version: Cardinal) |
94 | 114 | : Integer; cdecl; external libgit2_dll; |
@@ -145,5 +165,3 @@ function git_apply(repo: Pgit_repository; diff: Pgit_diff; location: git_apply_l |
145 | 165 |
|
146 | 166 | (** @} *) |
147 | 167 |
|
148 | | - |
149 | | - |
|
0 commit comments