Skip to content

Commit 11c8ef5

Browse files
committed
Update to 1.3.2
1 parent 6e06722 commit 11c8ef5

File tree

11 files changed

+191
-107
lines changed

11 files changed

+191
-107
lines changed

src/git2/attr.inc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,17 @@ type
141141
version: Cardinal;
142142
(** A combination of GIT_ATTR_CHECK flags *)
143143
flags: Cardinal;
144+
145+
{$IFDEF GIT_DEPRECATE_HARD}
146+
commit_id: Pgit_oid;
147+
{$ELSE}
148+
reserved: Pointer;
149+
{$ENDIF}
144150
(**
145151
* The commit to load attributes from, when
146152
* `GIT_ATTR_CHECK_INCLUDE_COMMIT` is specified.
147153
*)
148-
commit_id: Pgit_oid;
154+
attr_commit_id: git_oid;
149155
end;
150156
Pgit_attr_options = ^git_attr_options;
151157

src/git2/blob.inc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,16 @@ type
125125
version: Integer;
126126
(** Flags to control the filtering process, see `git_blob_filter_flag_t` above *)
127127
flags: uint32_t;
128+
{$IFDEF GIT_DEPRECATE_HARD}
129+
commit_id: Pgit_oid;
130+
{$ELSE}
131+
reserved: Pointer;
132+
{$ENDIF}
128133
(**
129134
* The commit to load attributes from, when
130135
* `GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT` is specified.
131136
*)
132-
commit_id: Pgit_oid;
137+
attr_commit_id: git_oid;
133138
end;
134139
Pgit_blob_filter_options = ^git_blob_filter_options;
135140

src/git2/common.inc

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @defgroup git_common Git common platform definitions
55
* @ingroup Git
66
* @{
7-
*)
7+
*)
88

99
const
1010
{$IFDEF MSWINDOWS}
@@ -128,6 +128,10 @@ const
128128
GIT_OPT_SET_MWINDOW_FILE_LIMIT = 30;
129129
GIT_OPT_SET_ODB_PACKED_PRIORITY = 31;
130130
GIT_OPT_SET_ODB_LOOSE_PRIORITY = 32;
131+
GIT_OPT_GET_EXTENSIONS = 33;
132+
GIT_OPT_SET_EXTENSIONS = 34;
133+
GIT_OPT_GET_OWNER_VALIDATION = 35;
134+
GIT_OPT_SET_OWNER_VALIDATION = 36;
131135
type
132136
git_libgit2_opt_t = Integer;
133137

@@ -351,11 +355,36 @@ type
351355
* > Override the default priority of the loose ODB backend which
352356
* > is added when default backends are assigned to a repository
353357
*
358+
* opts(GIT_OPT_GET_EXTENSIONS, git_strarray *out)
359+
* > Returns the list of git extensions that are supported. This
360+
* > is the list of built-in extensions supported by libgit2 and
361+
* > custom extensions that have been added with
362+
* > `GIT_OPT_SET_EXTENSIONS`. Extensions that have been negated
363+
* > will not be returned. The returned list should be released
364+
* > with `git_strarray_dispose`.
365+
*
366+
* opts(GIT_OPT_SET_EXTENSIONS, const char **extensions, size_t len)
367+
* > Set that the given git extensions are supported by the caller.
368+
* > Extensions supported by libgit2 may be negated by prefixing
369+
* > them with a `!`. For example: setting extensions to
370+
* > { "!noop", "newext" } indicates that the caller does not want
371+
* > to support repositories with the `noop` extension but does want
372+
* > to support repositories with the `newext` extension.
373+
*
374+
* opts(GIT_OPT_GET_OWNER_VALIDATION, int *enabled)
375+
* > Gets the owner validation setting for repository
376+
* > directories.
377+
*
378+
* opts(GIT_OPT_SET_OWNER_VALIDATION, int enabled)
379+
* > Set that repository directories should be owned by the current
380+
* > user. The default is to validate ownership.
381+
*
354382
* @param option Option key
355383
* @param ... value to set the option
356384
* @return 0 on success, <0 on failure
357-
*)
385+
*)
358386

359387
function git_libgit2_opts(option: Integer): Integer; cdecl varargs; external libgit2_dll;
360388

361389

390+

src/git2/diff.inc

Lines changed: 2 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ const
9696
* diff hunks.
9797
*)
9898
GIT_DIFF_INDENT_HEURISTIC = (1 shl 18);
99+
(** Ignore blank lines *)
100+
GIT_DIFF_IGNORE_BLANK_LINES = (1 shl 19);
99101
(** Treat all files as text, disabling binary attributes & detection *)
100102
GIT_DIFF_FORCE_TEXT = (1 shl 20);
101103
(** Treat all files as binary, disabling text diffs *)
@@ -126,8 +128,6 @@ const
126128
* can apply given diff information to binary files.
127129
*)
128130
GIT_DIFF_SHOW_BINARY = (1 shl 30);
129-
(** Ignore blank lines *)
130-
GIT_DIFF_IGNORE_BLANK_LINES = (1 shl 31);
131131
type
132132
git_diff_option_t = Integer;
133133

@@ -1272,89 +1272,6 @@ function git_diff_stats_to_buf(out_: Pgit_buf; stats: Pgit_diff_stats; format: g
12721272

12731273
procedure git_diff_stats_free(stats: Pgit_diff_stats); cdecl; external libgit2_dll;
12741274

1275-
(**
1276-
* Formatting options for diff e-mail generation
1277-
*)
1278-
1279-
const
1280-
(** Normal patch, the default *)
1281-
GIT_DIFF_FORMAT_EMAIL_NONE = 0;
1282-
(** Don't insert "[PATCH]" in the subject header *)
1283-
GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER = (1 shl 0);
1284-
type
1285-
git_diff_format_email_flags_t = Integer;
1286-
1287-
(**
1288-
* Options for controlling the formatting of the generated e-mail.
1289-
*)
1290-
1291-
type
1292-
git_diff_format_email_options = record
1293-
version: Cardinal;
1294-
(** see `git_diff_format_email_flags_t` above *)
1295-
flags: uint32_t;
1296-
(** This patch number *)
1297-
patch_no: size_t;
1298-
(** Total number of patches in this series *)
1299-
total_patches: size_t;
1300-
(** id to use for the commit *)
1301-
id: Pgit_oid;
1302-
(** Summary of the change *)
1303-
summary: PAnsiChar;
1304-
(** Commit message's body *)
1305-
body: PAnsiChar;
1306-
(** Author of the change *)
1307-
author: Pgit_signature;
1308-
end;
1309-
Pgit_diff_format_email_options = ^git_diff_format_email_options;
1310-
1311-
const
1312-
GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION = 1;
1313-
//GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT = { GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION , 0 , 1 , 1 , NULL , NULL , NULL , NULL };
1314-
(**
1315-
* Create an e-mail ready patch from a diff.
1316-
*
1317-
* @param out buffer to store the e-mail patch in
1318-
* @param diff containing the commit
1319-
* @param opts structure with options to influence content and formatting.
1320-
* @return 0 or an error code
1321-
*)
1322-
1323-
function git_diff_format_email(out_: Pgit_buf; diff: Pgit_diff;
1324-
opts: Pgit_diff_format_email_options): Integer; cdecl; external libgit2_dll;
1325-
1326-
(**
1327-
* Create an e-mail ready patch for a commit.
1328-
*
1329-
* Does not support creating patches for merge commits (yet).
1330-
*
1331-
* @param out buffer to store the e-mail patch in
1332-
* @param repo containing the commit
1333-
* @param commit pointer to up commit
1334-
* @param patch_no patch number of the commit
1335-
* @param total_patches total number of patches in the patch set
1336-
* @param flags determines the formatting of the e-mail
1337-
* @param diff_opts structure with options to influence diff or NULL for defaults.
1338-
* @return 0 or an error code
1339-
*)
1340-
1341-
function git_diff_commit_as_email(out_: Pgit_buf; repo: Pgit_repository; commit: Pgit_commit;
1342-
patch_no, total_patches: size_t; flags: uint32_t; diff_opts: Pgit_diff_options): Integer; cdecl; external libgit2_dll;
1343-
1344-
(**
1345-
* Initialize git_diff_format_email_options structure
1346-
*
1347-
* Initializes a `git_diff_format_email_options` with default values. Equivalent
1348-
* to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.
1349-
*
1350-
* @param opts The `git_blame_options` struct to initialize.
1351-
* @param version The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`.
1352-
* @return Zero on success; -1 on failure.
1353-
*)
1354-
1355-
function git_diff_format_email_options_init(opts: Pgit_diff_format_email_options;
1356-
version: Cardinal): Integer; cdecl; external libgit2_dll;
1357-
13581275
(**
13591276
* Patch ID options structure
13601277
*

src/git2/email.inc

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
(**
2+
* @file git2/email.h
3+
* @brief Git email formatting and application routines.
4+
* @ingroup Git
5+
* @{
6+
*)
7+
8+
(**
9+
* Formatting options for diff e-mail generation
10+
*)
11+
12+
const
13+
(** Normal patch, the default *)
14+
GIT_EMAIL_CREATE_DEFAULT = 0;
15+
(** do not include patch numbers in the subject prefix. *)
16+
GIT_EMAIL_CREATE_OMIT_NUMBERS = 1 shl 0;
17+
18+
(**
19+
* Include numbers in the subject prefix even when the
20+
* patch is for a single commit (1/1).
21+
*)
22+
GIT_EMAIL_CREATE_ALWAYS_NUMBER = 1 shl 1;
23+
24+
(** Do not perform rename or similarity detection. *)
25+
GIT_EMAIL_CREATE_NO_RENAMES = 1 shl 2;
26+
type
27+
git_email_create_flags_t = Integer;
28+
29+
(**
30+
* Options for controlling the formatting of the generated e-mail.
31+
*)
32+
33+
type
34+
git_email_create_options = record
35+
version: Cardinal;
36+
(** see `git_email_create_flags_t` above *)
37+
flags: uint32_t;
38+
(** Options to use when creating diffs *)
39+
diff_opts: git_diff_options;
40+
41+
(** Options for finding similarities within diffs *)
42+
diff_find_opts: git_diff_find_options;
43+
44+
(**
45+
* The subject prefix, by default "PATCH". If set to an empty
46+
* string ("") then only the patch numbers will be shown in the
47+
* prefix. If the subject_prefix is empty and patch numbers
48+
* are not being shown, the prefix will be omitted entirely.
49+
*)
50+
subject_prefix: PAnsiChar;
51+
52+
(**
53+
* The starting patch number; this cannot be 0. By default,
54+
* this is 1.
55+
*)
56+
start_number: size_t;
57+
58+
(** The "re-roll" number. By default, there is no re-roll. *)
59+
reroll_number: size_t;
60+
61+
(** This patch number *)
62+
patch_no: size_t;
63+
(** Total number of patches in this series *)
64+
total_patches: size_t;
65+
(** id to use for the commit *)
66+
id: Pgit_oid;
67+
(** Summary of the change *)
68+
summary: PAnsiChar;
69+
(** Commit message's body *)
70+
body: PAnsiChar;
71+
(** Author of the change *)
72+
author: Pgit_signature;
73+
end;
74+
Pgit_email_create_options = ^git_email_create_options;
75+
76+
const
77+
GIT_EMAIL_CREATE_OPTIONS_VERSION = 1;
78+
(*GIT_EMAIL_CREATE_OPTIONS_INIT =
79+
{ \
80+
GIT_EMAIL_CREATE_OPTIONS_VERSION, \
81+
GIT_EMAIL_CREATE_DEFAULT, \
82+
{ GIT_DIFF_OPTIONS_VERSION, GIT_DIFF_SHOW_BINARY, GIT_SUBMODULE_IGNORE_UNSPECIFIED, {NULL,0}, NULL, NULL, NULL, 3 }, \
83+
GIT_DIFF_FIND_OPTIONS_INIT \
84+
}
85+
*)
86+
87+
(**
88+
* Create a diff for a commit in mbox format for sending via email.
89+
*
90+
* @param out buffer to store the e-mail patch in
91+
* @param diff the changes to include in the email
92+
* @param patch_idx the patch index
93+
* @param patch_count the total number of patches that will be included
94+
* @param commit_id the commit id for this change
95+
* @param summary the commit message for this change
96+
* @param body optional text to include above the diffstat
97+
* @param author the person who authored this commit
98+
* @param opts email creation options
99+
*)
100+
101+
function git_email_create_from_diff(_out: Pgit_buf; diff: Pgit_diff; patch_idx: size_t; patch_count: size_t;
102+
commit_id: Pgit_oid; summary: PAnsiChar; body: PAnsiChar; author: Pgit_signature;
103+
opts: Pgit_email_create_options): Integer; cdecl; external libgit2_dll;
104+
105+
(**
106+
* Create a diff for a commit in mbox format for sending via email.
107+
* The commit must not be a merge commit.
108+
*
109+
* @param out buffer to store the e-mail patch in
110+
* @param commit commit to create a patch for
111+
* @param opts email creation options
112+
*)
113+
114+
function git_email_create_from_commit(_out: Pgit_buf; commit: Pgit_commit;
115+
opts: Pgit_email_create_options): Integer; cdecl; external libgit2_dll;
116+
117+
(** @} *)
118+
119+
120+

src/git2/errors.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const
4343
GIT_EMISMATCH = -33; (**< Hashsum mismatch in object *)
4444
GIT_EINDEXDIRTY = -34; (**< Unsaved changes in the index would be overwritten *)
4545
GIT_EAPPLYFAIL = -35; (**< Patch application failed *)
46+
GIT_EOWNER = -36; (**< The object is not owned by the current user *)
4647
type
4748
git_error_code = Integer;
4849

@@ -156,3 +157,4 @@ procedure git_error_set_oom; cdecl; external libgit2_dll;
156157
(** @} *)
157158

158159

160+

src/git2/filter.inc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,16 @@ type
5151
(** See `git_filter_flag_t` above *)
5252
flags: Cardinal;
5353

54+
{$IFDEF GIT_DEPRECATE_HARD}
55+
commit_id: Pgit_oid;
56+
{$ELSE}
57+
reserved: Pointer;
58+
{$ENDIF}
5459
(**
5560
* The commit to load attributes from, when
5661
* `GIT_FILTER_ATTRIBUTES_FROM_COMMIT` is specified.
5762
*)
58-
commit_id: Pgit_oid;
63+
attr_commit_id: git_oid;
5964
end;
6065
Pgit_filter_options = ^git_filter_options;
6166

src/git2/oidarray.inc

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,20 @@ type
77
end;
88

99
(**
10-
* Free the OID array
11-
*
12-
* This method must (and must only) be called on `git_oidarray`
13-
* objects where the array is allocated by the library. Not doing so,
14-
* will result in a memory leak.
10+
* Free the object IDs contained in an oid_array. This method should
11+
* be called on `git_oidarray` objects that were provided by the
12+
* library. Not doing so will result in a memory leak.
1513
*
1614
* This does not free the `git_oidarray` itself, since the library will
17-
* never allocate that object directly itself (it is more commonly embedded
18-
* inside another struct or created on the stack).
15+
* never allocate that object directly itself.
1916
*
2017
* @param array git_oidarray from which to free oid data
2118
*)
2219

2320
type
2421
Pgit_oidarray = ^git_oidarray;
2522

26-
procedure git_oidarray_free(array_: Pgit_oidarray); cdecl; external libgit2_dll;
23+
procedure git_oidarray_dispose(array_: Pgit_oidarray); cdecl; external libgit2_dll;
2724

2825
(** @} *)
2926

0 commit comments

Comments
 (0)