rugged 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rugged/version.rb +1 -1
  3. data/vendor/libgit2/CMakeLists.txt +1 -1
  4. data/vendor/libgit2/cmake/FindLibSSH2.cmake +13 -0
  5. data/vendor/libgit2/include/git2/attr.h +7 -1
  6. data/vendor/libgit2/include/git2/blob.h +7 -1
  7. data/vendor/libgit2/include/git2/clone.h +1 -1
  8. data/vendor/libgit2/include/git2/common.h +19 -1
  9. data/vendor/libgit2/include/git2/deprecated.h +120 -0
  10. data/vendor/libgit2/include/git2/diff.h +3 -97
  11. data/vendor/libgit2/include/git2/email.h +127 -0
  12. data/vendor/libgit2/include/git2/filter.h +7 -1
  13. data/vendor/libgit2/include/git2/notes.h +2 -2
  14. data/vendor/libgit2/include/git2/oidarray.h +5 -8
  15. data/vendor/libgit2/include/git2/remote.h +4 -4
  16. data/vendor/libgit2/include/git2/repository.h +12 -10
  17. data/vendor/libgit2/include/git2/stash.h +1 -1
  18. data/vendor/libgit2/include/git2/stdint.h +3 -3
  19. data/vendor/libgit2/include/git2/sys/email.h +45 -0
  20. data/vendor/libgit2/include/git2/version.h +3 -3
  21. data/vendor/libgit2/include/git2.h +1 -0
  22. data/vendor/libgit2/src/CMakeLists.txt +7 -0
  23. data/vendor/libgit2/src/attr.c +24 -9
  24. data/vendor/libgit2/src/attr_file.c +23 -15
  25. data/vendor/libgit2/src/attr_file.h +3 -3
  26. data/vendor/libgit2/src/blame.c +4 -4
  27. data/vendor/libgit2/src/blame_git.c +1 -1
  28. data/vendor/libgit2/src/blob.c +15 -9
  29. data/vendor/libgit2/src/buffer.c +16 -8
  30. data/vendor/libgit2/src/buffer.h +2 -1
  31. data/vendor/libgit2/src/cc-compat.h +1 -7
  32. data/vendor/libgit2/src/checkout.c +6 -7
  33. data/vendor/libgit2/src/clone.c +1 -1
  34. data/vendor/libgit2/src/commit_graph.c +1 -1
  35. data/vendor/libgit2/src/config.c +1 -1
  36. data/vendor/libgit2/src/config_file.c +2 -2
  37. data/vendor/libgit2/src/config_parse.c +1 -1
  38. data/vendor/libgit2/src/describe.c +1 -1
  39. data/vendor/libgit2/src/diff.c +41 -173
  40. data/vendor/libgit2/src/email.c +299 -0
  41. data/vendor/libgit2/src/email.h +25 -0
  42. data/vendor/libgit2/src/filter.c +7 -1
  43. data/vendor/libgit2/src/hash/sha1/sha1dc/sha1.c +8 -8
  44. data/vendor/libgit2/src/ignore.c +2 -2
  45. data/vendor/libgit2/src/indexer.c +37 -3
  46. data/vendor/libgit2/src/libgit2.c +23 -0
  47. data/vendor/libgit2/src/merge.c +7 -4
  48. data/vendor/libgit2/src/notes.c +31 -31
  49. data/vendor/libgit2/src/oidarray.c +10 -1
  50. data/vendor/libgit2/src/path.c +1 -1
  51. data/vendor/libgit2/src/path.h +1 -1
  52. data/vendor/libgit2/src/pathspec.c +1 -1
  53. data/vendor/libgit2/src/refdb_fs.c +1 -1
  54. data/vendor/libgit2/src/refs.c +2 -2
  55. data/vendor/libgit2/src/refspec.c +1 -1
  56. data/vendor/libgit2/src/remote.c +12 -5
  57. data/vendor/libgit2/src/repository.c +130 -19
  58. data/vendor/libgit2/src/repository.h +4 -0
  59. data/vendor/libgit2/src/reset.c +1 -1
  60. data/vendor/libgit2/src/revparse.c +4 -4
  61. data/vendor/libgit2/src/stash.c +1 -1
  62. data/vendor/libgit2/src/streams/openssl_legacy.c +1 -1
  63. data/vendor/libgit2/src/streams/openssl_legacy.h +1 -1
  64. data/vendor/libgit2/src/threadstate.c +2 -1
  65. data/vendor/libgit2/src/trailer.c +1 -1
  66. data/vendor/libgit2/src/transports/ssh.c +4 -4
  67. data/vendor/libgit2/src/transports/winhttp.c +1 -1
  68. data/vendor/libgit2/src/util.c +1 -1
  69. data/vendor/libgit2/src/util.h +1 -1
  70. data/vendor/libgit2/src/win32/findfile.c +1 -1
  71. data/vendor/libgit2/src/win32/posix.h +6 -6
  72. data/vendor/libgit2/src/win32/posix_w32.c +9 -6
  73. metadata +11 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19936f56e898dca579bf9fcf65f00269b370f258cacf7ca8bd5078a87adc4671
4
- data.tar.gz: 401815655a41971104e0a4f798c9558caf435810b30f26057b3685f597e1252a
3
+ metadata.gz: d2445a318b46ff0a26c2fbc62b53b5351eb95cee994fa508d267b9c0f9a14edc
4
+ data.tar.gz: fe54aabe575a4a922f6fd8623252d26bcf278d40ba0823b21a367faab7411720
5
5
  SHA512:
6
- metadata.gz: 1f2c4a448530f16527106b68698d8515680c6bd5bb2e2cccd06ce3abffdae089f8b9a230adc89ce25866c13279ede19a4bb7ba0319f5afc05062e8bcb6046bce
7
- data.tar.gz: faad75d0f246a51902dec3f8805fd91dce80add042e737b1bf6df437e41988987e1f88cd9296e798fbba3f94d246e2592895b28d484a63b5b507417a0605d147
6
+ metadata.gz: 49024fdc5cb1f9a1703c8b142f38799aa2fe78eb0abb2506befc84e5899225a347cdb09af0af5709bd5f4b29599f5cd2ebe05757466803cba25e5b747fbe59ad
7
+ data.tar.gz: 024216a35e8310c6ac6dc5e7dfc73b06f06c66960f6307c3dd35f52f4d8ee46bab40504de2d73dd3f61df665aeccdef4dc41f2ed2ebed7411f5cfd7858e3ef00
@@ -4,5 +4,5 @@
4
4
  # For full terms see the included LICENSE file.
5
5
 
6
6
  module Rugged
7
- Version = VERSION = '1.2.0'
7
+ Version = VERSION = '1.3.0'
8
8
  end
@@ -13,7 +13,7 @@
13
13
 
14
14
  CMAKE_MINIMUM_REQUIRED(VERSION 3.5.1)
15
15
 
16
- project(libgit2 VERSION "1.2.0" LANGUAGES C)
16
+ project(libgit2 VERSION "1.3.0" LANGUAGES C)
17
17
 
18
18
  # Add find modules to the path
19
19
  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${libgit2_SOURCE_DIR}/cmake/")
@@ -0,0 +1,13 @@
1
+ # LIBSSH2_FOUND - system has the libssh2 library
2
+ # LIBSSH2_INCLUDE_DIR - the libssh2 include directory
3
+ # LIBSSH2_LIBRARY - the libssh2 library name
4
+
5
+ FIND_PATH(LIBSSH2_INCLUDE_DIR libssh2.h)
6
+
7
+ FIND_LIBRARY(LIBSSH2_LIBRARY NAMES ssh2 libssh2)
8
+
9
+ INCLUDE(FindPackageHandleStandardArgs)
10
+ find_package_handle_standard_args(LibSSH2
11
+ REQUIRED_VARS LIBSSH2_LIBRARY LIBSSH2_INCLUDE_DIR)
12
+
13
+ MARK_AS_ADVANCED(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY)
@@ -147,11 +147,17 @@ typedef struct {
147
147
  /** A combination of GIT_ATTR_CHECK flags */
148
148
  unsigned int flags;
149
149
 
150
+ #ifdef GIT_DEPRECATE_HARD
151
+ void *reserved;
152
+ #else
153
+ git_oid *commit_id;
154
+ #endif
155
+
150
156
  /**
151
157
  * The commit to load attributes from, when
152
158
  * `GIT_ATTR_CHECK_INCLUDE_COMMIT` is specified.
153
159
  */
154
- git_oid *commit_id;
160
+ git_oid attr_commit_id;
155
161
  } git_attr_options;
156
162
 
157
163
  #define GIT_ATTR_OPTIONS_VERSION 1
@@ -135,11 +135,17 @@ typedef struct {
135
135
  /** Flags to control the filtering process, see `git_blob_filter_flag_t` above */
136
136
  uint32_t flags;
137
137
 
138
+ #ifdef GIT_DEPRECATE_HARD
139
+ void *reserved;
140
+ #else
141
+ git_oid *commit_id;
142
+ #endif
143
+
138
144
  /**
139
145
  * The commit to load attributes from, when
140
146
  * `GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT` is specified.
141
147
  */
142
- git_oid *commit_id;
148
+ git_oid attr_commit_id;
143
149
  } git_blob_filter_options;
144
150
 
145
151
  #define GIT_BLOB_FILTER_OPTIONS_VERSION 1
@@ -133,7 +133,7 @@ typedef struct git_clone_options {
133
133
  * The name of the branch to checkout. NULL means use the
134
134
  * remote's default branch.
135
135
  */
136
- const char* checkout_branch;
136
+ const char *checkout_branch;
137
137
 
138
138
  /**
139
139
  * A callback used to create the new repository into which to
@@ -209,7 +209,9 @@ typedef enum {
209
209
  GIT_OPT_GET_MWINDOW_FILE_LIMIT,
210
210
  GIT_OPT_SET_MWINDOW_FILE_LIMIT,
211
211
  GIT_OPT_SET_ODB_PACKED_PRIORITY,
212
- GIT_OPT_SET_ODB_LOOSE_PRIORITY
212
+ GIT_OPT_SET_ODB_LOOSE_PRIORITY,
213
+ GIT_OPT_GET_EXTENSIONS,
214
+ GIT_OPT_SET_EXTENSIONS
213
215
  } git_libgit2_opt_t;
214
216
 
215
217
  /**
@@ -431,6 +433,22 @@ typedef enum {
431
433
  * > Override the default priority of the loose ODB backend which
432
434
  * > is added when default backends are assigned to a repository
433
435
  *
436
+ * opts(GIT_OPT_GET_EXTENSIONS, git_strarray *out)
437
+ * > Returns the list of git extensions that are supported. This
438
+ * > is the list of built-in extensions supported by libgit2 and
439
+ * > custom extensions that have been added with
440
+ * > `GIT_OPT_SET_EXTENSIONS`. Extensions that have been negated
441
+ * > will not be returned. The returned list should be released
442
+ * > with `git_strarray_dispose`.
443
+ *
444
+ * opts(GIT_OPT_SET_EXTENSIONS, const char **extensions, size_t len)
445
+ * > Set that the given git extensions are supported by the caller.
446
+ * > Extensions supported by libgit2 may be negated by prefixing
447
+ * > them with a `!`. For example: setting extensions to
448
+ * > { "!noop", "newext" } indicates that the caller does not want
449
+ * > to support repositories with the `noop` extension but does want
450
+ * > to support repositories with the `newext` extension.
451
+ *
434
452
  * @param option Option key
435
453
  * @param ... value to set the option
436
454
  * @return 0 on success, <0 on failure
@@ -294,6 +294,102 @@ typedef git_configmap git_cvar_map;
294
294
 
295
295
  /**@}*/
296
296
 
297
+ /** @name Deprecated Diff Functions and Constants
298
+ *
299
+ * These functions and enumeration values are retained for backward
300
+ * compatibility. The newer versions of these functions and values
301
+ * should be preferred in all new code.
302
+ *
303
+ * There is no plan to remove these backward compatibility values at
304
+ * this time.
305
+ */
306
+ /**@{*/
307
+
308
+ /**
309
+ * Formatting options for diff e-mail generation
310
+ */
311
+ typedef enum {
312
+ /** Normal patch, the default */
313
+ GIT_DIFF_FORMAT_EMAIL_NONE = 0,
314
+
315
+ /** Don't insert "[PATCH]" in the subject header*/
316
+ GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER = (1 << 0),
317
+
318
+ } git_diff_format_email_flags_t;
319
+
320
+ /**
321
+ * Options for controlling the formatting of the generated e-mail.
322
+ */
323
+ typedef struct {
324
+ unsigned int version;
325
+
326
+ /** see `git_diff_format_email_flags_t` above */
327
+ uint32_t flags;
328
+
329
+ /** This patch number */
330
+ size_t patch_no;
331
+
332
+ /** Total number of patches in this series */
333
+ size_t total_patches;
334
+
335
+ /** id to use for the commit */
336
+ const git_oid *id;
337
+
338
+ /** Summary of the change */
339
+ const char *summary;
340
+
341
+ /** Commit message's body */
342
+ const char *body;
343
+
344
+ /** Author of the change */
345
+ const git_signature *author;
346
+ } git_diff_format_email_options;
347
+
348
+ #define GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION 1
349
+ #define GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT {GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION, 0, 1, 1, NULL, NULL, NULL, NULL}
350
+
351
+ /**
352
+ * Create an e-mail ready patch from a diff.
353
+ *
354
+ * @deprecated git_email_create_from_diff
355
+ * @see git_email_create_from_diff
356
+ */
357
+ GIT_EXTERN(int) git_diff_format_email(
358
+ git_buf *out,
359
+ git_diff *diff,
360
+ const git_diff_format_email_options *opts);
361
+
362
+ /**
363
+ * Create an e-mail ready patch for a commit.
364
+ *
365
+ * @deprecated git_email_create_from_commit
366
+ * @see git_email_create_from_commit
367
+ */
368
+ GIT_EXTERN(int) git_diff_commit_as_email(
369
+ git_buf *out,
370
+ git_repository *repo,
371
+ git_commit *commit,
372
+ size_t patch_no,
373
+ size_t total_patches,
374
+ uint32_t flags,
375
+ const git_diff_options *diff_opts);
376
+
377
+ /**
378
+ * Initialize git_diff_format_email_options structure
379
+ *
380
+ * Initializes a `git_diff_format_email_options` with default values. Equivalent
381
+ * to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.
382
+ *
383
+ * @param opts The `git_blame_options` struct to initialize.
384
+ * @param version The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`.
385
+ * @return Zero on success; -1 on failure.
386
+ */
387
+ GIT_EXTERN(int) git_diff_format_email_options_init(
388
+ git_diff_format_email_options *opts,
389
+ unsigned int version);
390
+
391
+ /**@}*/
392
+
297
393
  /** @name Deprecated Error Functions and Constants
298
394
  *
299
395
  * These functions and enumeration values are retained for backward
@@ -683,6 +779,30 @@ GIT_EXTERN(int) git_oid_iszero(const git_oid *id);
683
779
 
684
780
  /**@}*/
685
781
 
782
+ /** @name Deprecated OID Array Functions
783
+ *
784
+ * These types are retained for backward compatibility. The newer
785
+ * versions of these values should be preferred in all new code.
786
+ *
787
+ * There is no plan to remove these backward compatibility values at
788
+ * this time.
789
+ */
790
+ /**@{*/
791
+
792
+ /**
793
+ * Free the memory referred to by the git_oidarray. This is an alias of
794
+ * `git_oidarray_dispose` and is preserved for backward compatibility.
795
+ *
796
+ * This function is deprecated, but there is no plan to remove this
797
+ * function at this time.
798
+ *
799
+ * @deprecated Use git_oidarray_dispose
800
+ * @see git_oidarray_dispose
801
+ */
802
+ GIT_EXTERN(void) git_oidarray_free(git_oidarray *array);
803
+
804
+ /**@}*/
805
+
686
806
  /** @name Deprecated Transfer Progress Types
687
807
  *
688
808
  * These types are retained for backward compatibility. The newer
@@ -133,6 +133,9 @@ typedef enum {
133
133
  */
134
134
  GIT_DIFF_INDENT_HEURISTIC = (1u << 18),
135
135
 
136
+ /** Ignore blank lines */
137
+ GIT_DIFF_IGNORE_BLANK_LINES = (1u << 19),
138
+
136
139
  /** Treat all files as text, disabling binary attributes & detection */
137
140
  GIT_DIFF_FORCE_TEXT = (1u << 20),
138
141
  /** Treat all files as binary, disabling text diffs */
@@ -168,10 +171,6 @@ typedef enum {
168
171
  * can apply given diff information to binary files.
169
172
  */
170
173
  GIT_DIFF_SHOW_BINARY = (1u << 30),
171
-
172
- /** Ignore blank lines */
173
- GIT_DIFF_IGNORE_BLANK_LINES = (1u << 31),
174
-
175
174
  } git_diff_option_t;
176
175
 
177
176
  /**
@@ -1376,99 +1375,6 @@ GIT_EXTERN(int) git_diff_stats_to_buf(
1376
1375
  */
1377
1376
  GIT_EXTERN(void) git_diff_stats_free(git_diff_stats *stats);
1378
1377
 
1379
- /**
1380
- * Formatting options for diff e-mail generation
1381
- */
1382
- typedef enum {
1383
- /** Normal patch, the default */
1384
- GIT_DIFF_FORMAT_EMAIL_NONE = 0,
1385
-
1386
- /** Don't insert "[PATCH]" in the subject header*/
1387
- GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER = (1 << 0),
1388
-
1389
- } git_diff_format_email_flags_t;
1390
-
1391
- /**
1392
- * Options for controlling the formatting of the generated e-mail.
1393
- */
1394
- typedef struct {
1395
- unsigned int version;
1396
-
1397
- /** see `git_diff_format_email_flags_t` above */
1398
- uint32_t flags;
1399
-
1400
- /** This patch number */
1401
- size_t patch_no;
1402
-
1403
- /** Total number of patches in this series */
1404
- size_t total_patches;
1405
-
1406
- /** id to use for the commit */
1407
- const git_oid *id;
1408
-
1409
- /** Summary of the change */
1410
- const char *summary;
1411
-
1412
- /** Commit message's body */
1413
- const char *body;
1414
-
1415
- /** Author of the change */
1416
- const git_signature *author;
1417
- } git_diff_format_email_options;
1418
-
1419
- #define GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION 1
1420
- #define GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT {GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION, 0, 1, 1, NULL, NULL, NULL, NULL}
1421
-
1422
- /**
1423
- * Create an e-mail ready patch from a diff.
1424
- *
1425
- * @param out buffer to store the e-mail patch in
1426
- * @param diff containing the commit
1427
- * @param opts structure with options to influence content and formatting.
1428
- * @return 0 or an error code
1429
- */
1430
- GIT_EXTERN(int) git_diff_format_email(
1431
- git_buf *out,
1432
- git_diff *diff,
1433
- const git_diff_format_email_options *opts);
1434
-
1435
- /**
1436
- * Create an e-mail ready patch for a commit.
1437
- *
1438
- * Does not support creating patches for merge commits (yet).
1439
- *
1440
- * @param out buffer to store the e-mail patch in
1441
- * @param repo containing the commit
1442
- * @param commit pointer to up commit
1443
- * @param patch_no patch number of the commit
1444
- * @param total_patches total number of patches in the patch set
1445
- * @param flags determines the formatting of the e-mail
1446
- * @param diff_opts structure with options to influence diff or NULL for defaults.
1447
- * @return 0 or an error code
1448
- */
1449
- GIT_EXTERN(int) git_diff_commit_as_email(
1450
- git_buf *out,
1451
- git_repository *repo,
1452
- git_commit *commit,
1453
- size_t patch_no,
1454
- size_t total_patches,
1455
- uint32_t flags,
1456
- const git_diff_options *diff_opts);
1457
-
1458
- /**
1459
- * Initialize git_diff_format_email_options structure
1460
- *
1461
- * Initializes a `git_diff_format_email_options` with default values. Equivalent
1462
- * to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.
1463
- *
1464
- * @param opts The `git_blame_options` struct to initialize.
1465
- * @param version The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`.
1466
- * @return Zero on success; -1 on failure.
1467
- */
1468
- GIT_EXTERN(int) git_diff_format_email_options_init(
1469
- git_diff_format_email_options *opts,
1470
- unsigned int version);
1471
-
1472
1378
  /**
1473
1379
  * Patch ID options structure
1474
1380
  *
@@ -0,0 +1,127 @@
1
+ /*
2
+ * Copyright (C) the libgit2 contributors. All rights reserved.
3
+ *
4
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
5
+ * a Linking Exception. For full terms see the included COPYING file.
6
+ */
7
+ #ifndef INCLUDE_git_email_h__
8
+ #define INCLUDE_git_email_h__
9
+
10
+ #include "common.h"
11
+
12
+ /**
13
+ * @file git2/email.h
14
+ * @brief Git email formatting and application routines.
15
+ * @ingroup Git
16
+ * @{
17
+ */
18
+ GIT_BEGIN_DECL
19
+
20
+ /**
21
+ * Formatting options for diff e-mail generation
22
+ */
23
+ typedef enum {
24
+ /** Normal patch, the default */
25
+ GIT_EMAIL_CREATE_DEFAULT = 0,
26
+
27
+ /** Do not include patch numbers in the subject prefix. */
28
+ GIT_EMAIL_CREATE_OMIT_NUMBERS = (1u << 0),
29
+
30
+ /**
31
+ * Include numbers in the subject prefix even when the
32
+ * patch is for a single commit (1/1).
33
+ */
34
+ GIT_EMAIL_CREATE_ALWAYS_NUMBER = (1u << 1),
35
+
36
+ /** Do not perform rename or similarity detection. */
37
+ GIT_EMAIL_CREATE_NO_RENAMES = (1u << 2),
38
+ } git_email_create_flags_t;
39
+
40
+ /**
41
+ * Options for controlling the formatting of the generated e-mail.
42
+ */
43
+ typedef struct {
44
+ unsigned int version;
45
+
46
+ /** see `git_email_create_flags_t` above */
47
+ uint32_t flags;
48
+
49
+ /** Options to use when creating diffs */
50
+ git_diff_options diff_opts;
51
+
52
+ /** Options for finding similarities within diffs */
53
+ git_diff_find_options diff_find_opts;
54
+
55
+ /**
56
+ * The subject prefix, by default "PATCH". If set to an empty
57
+ * string ("") then only the patch numbers will be shown in the
58
+ * prefix. If the subject_prefix is empty and patch numbers
59
+ * are not being shown, the prefix will be omitted entirely.
60
+ */
61
+ const char *subject_prefix;
62
+
63
+ /**
64
+ * The starting patch number; this cannot be 0. By default,
65
+ * this is 1.
66
+ */
67
+ size_t start_number;
68
+
69
+ /** The "re-roll" number. By default, there is no re-roll. */
70
+ size_t reroll_number;
71
+ } git_email_create_options;
72
+
73
+ /*
74
+ * By default, our options include rename detection and binary
75
+ * diffs to match `git format-patch`.
76
+ */
77
+ #define GIT_EMAIL_CREATE_OPTIONS_VERSION 1
78
+ #define 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
+ * Create a diff for a commit in mbox format for sending via email.
88
+ *
89
+ * @param out buffer to store the e-mail patch in
90
+ * @param diff the changes to include in the email
91
+ * @param patch_idx the patch index
92
+ * @param patch_count the total number of patches that will be included
93
+ * @param commit_id the commit id for this change
94
+ * @param summary the commit message for this change
95
+ * @param body optional text to include above the diffstat
96
+ * @param author the person who authored this commit
97
+ * @param opts email creation options
98
+ */
99
+ GIT_EXTERN(int) git_email_create_from_diff(
100
+ git_buf *out,
101
+ git_diff *diff,
102
+ size_t patch_idx,
103
+ size_t patch_count,
104
+ const git_oid *commit_id,
105
+ const char *summary,
106
+ const char *body,
107
+ const git_signature *author,
108
+ const git_email_create_options *opts);
109
+
110
+ /**
111
+ * Create a diff for a commit in mbox format for sending via email.
112
+ * The commit must not be a merge commit.
113
+ *
114
+ * @param out buffer to store the e-mail patch in
115
+ * @param commit commit to create a patch for
116
+ * @param opts email creation options
117
+ */
118
+ GIT_EXTERN(int) git_email_create_from_commit(
119
+ git_buf *out,
120
+ git_commit *commit,
121
+ const git_email_create_options *opts);
122
+
123
+ GIT_END_DECL
124
+
125
+ /** @} */
126
+
127
+ #endif
@@ -66,11 +66,17 @@ typedef struct {
66
66
  /** See `git_filter_flag_t` above */
67
67
  uint32_t flags;
68
68
 
69
+ #ifdef GIT_DEPRECATE_HARD
70
+ void *reserved;
71
+ #else
72
+ git_oid *commit_id;
73
+ #endif
74
+
69
75
  /**
70
76
  * The commit to load attributes from, when
71
77
  * `GIT_FILTER_ATTRIBUTES_FROM_COMMIT` is specified.
72
78
  */
73
- git_oid *commit_id;
79
+ git_oid attr_commit_id;
74
80
  } git_filter_options;
75
81
 
76
82
  #define GIT_FILTER_OPTIONS_VERSION 1
@@ -84,8 +84,8 @@ GIT_EXTERN(void) git_note_iterator_free(git_note_iterator *it);
84
84
  * (negative value)
85
85
  */
86
86
  GIT_EXTERN(int) git_note_next(
87
- git_oid* note_id,
88
- git_oid* annotated_id,
87
+ git_oid *note_id,
88
+ git_oid *annotated_id,
89
89
  git_note_iterator *it);
90
90
 
91
91
 
@@ -19,19 +19,16 @@ typedef struct git_oidarray {
19
19
  } git_oidarray;
20
20
 
21
21
  /**
22
- * Free the OID array
23
- *
24
- * This method must (and must only) be called on `git_oidarray`
25
- * objects where the array is allocated by the library. Not doing so,
26
- * will result in a memory leak.
22
+ * Free the object IDs contained in an oid_array. This method should
23
+ * be called on `git_oidarray` objects that were provided by the
24
+ * library. Not doing so will result in a memory leak.
27
25
  *
28
26
  * This does not free the `git_oidarray` itself, since the library will
29
- * never allocate that object directly itself (it is more commonly embedded
30
- * inside another struct or created on the stack).
27
+ * never allocate that object directly itself.
31
28
  *
32
29
  * @param array git_oidarray from which to free oid data
33
30
  */
34
- GIT_EXTERN(void) git_oidarray_free(git_oidarray *array);
31
+ GIT_EXTERN(void) git_oidarray_dispose(git_oidarray *array);
35
32
 
36
33
  /** @} */
37
34
  GIT_END_DECL
@@ -243,7 +243,7 @@ GIT_EXTERN(const char *) git_remote_pushurl(const git_remote *remote);
243
243
  * @param url the url to set
244
244
  * @return 0 or an error value
245
245
  */
246
- GIT_EXTERN(int) git_remote_set_url(git_repository *repo, const char *remote, const char* url);
246
+ GIT_EXTERN(int) git_remote_set_url(git_repository *repo, const char *remote, const char *url);
247
247
 
248
248
  /**
249
249
  * Set the remote's url for pushing in the configuration.
@@ -257,7 +257,7 @@ GIT_EXTERN(int) git_remote_set_url(git_repository *repo, const char *remote, con
257
257
  * @param url the url to set
258
258
  * @return 0, or an error code
259
259
  */
260
- GIT_EXTERN(int) git_remote_set_pushurl(git_repository *repo, const char *remote, const char* url);
260
+ GIT_EXTERN(int) git_remote_set_pushurl(git_repository *repo, const char *remote, const char *url);
261
261
 
262
262
  /**
263
263
  * Set the url for this particular url instance. The URL in the
@@ -451,7 +451,7 @@ typedef int GIT_CALLBACK(git_push_transfer_progress_cb)(
451
451
  unsigned int current,
452
452
  unsigned int total,
453
453
  size_t bytes,
454
- void* payload);
454
+ void *payload);
455
455
 
456
456
  /**
457
457
  * Represents an update which will be performed on the remote during push
@@ -971,7 +971,7 @@ GIT_EXTERN(int) git_remote_rename(
971
971
  * @param remote_name name to be checked.
972
972
  * @return 0 on success or an error code
973
973
  */
974
- int git_remote_name_is_valid(int *valid, const char *remote_name);
974
+ GIT_EXTERN(int) git_remote_name_is_valid(int *valid, const char *remote_name);
975
975
 
976
976
  /**
977
977
  * Delete an existing persisted remote.
@@ -762,13 +762,15 @@ GIT_EXTERN(int) git_repository_mergehead_foreach(
762
762
  *
763
763
  * @param out Output value of calculated SHA
764
764
  * @param repo Repository pointer
765
- * @param path Path to file on disk whose contents should be hashed. If the
766
- * repository is not NULL, this can be a relative path.
765
+ * @param path Path to file on disk whose contents should be hashed. This
766
+ * may be an absolute path or a relative path, in which case it
767
+ * will be treated as a path within the working directory.
767
768
  * @param type The object type to hash as (e.g. GIT_OBJECT_BLOB)
768
769
  * @param as_path The path to use to look up filtering rules. If this is
769
- * NULL, then the `path` parameter will be used instead. If
770
- * this is passed as the empty string, then no filters will be
771
- * applied when calculating the hash.
770
+ * an empty string then no filters will be applied when
771
+ * calculating the hash. If this is `NULL` and the `path`
772
+ * parameter is a file within the repository's working
773
+ * directory, then the `path` will be used.
772
774
  * @return 0 on success, or an error code
773
775
  */
774
776
  GIT_EXTERN(int) git_repository_hashfile(
@@ -797,8 +799,8 @@ GIT_EXTERN(int) git_repository_hashfile(
797
799
  * @return 0 on success, or an error code
798
800
  */
799
801
  GIT_EXTERN(int) git_repository_set_head(
800
- git_repository* repo,
801
- const char* refname);
802
+ git_repository *repo,
803
+ const char *refname);
802
804
 
803
805
  /**
804
806
  * Make the repository HEAD directly point to the Commit.
@@ -817,8 +819,8 @@ GIT_EXTERN(int) git_repository_set_head(
817
819
  * @return 0 on success, or an error code
818
820
  */
819
821
  GIT_EXTERN(int) git_repository_set_head_detached(
820
- git_repository* repo,
821
- const git_oid* commitish);
822
+ git_repository *repo,
823
+ const git_oid *commitish);
822
824
 
823
825
  /**
824
826
  * Make the repository HEAD directly point to the Commit.
@@ -854,7 +856,7 @@ GIT_EXTERN(int) git_repository_set_head_detached_from_annotated(
854
856
  * branch or an error code
855
857
  */
856
858
  GIT_EXTERN(int) git_repository_detach_head(
857
- git_repository* repo);
859
+ git_repository *repo);
858
860
 
859
861
  /**
860
862
  * Repository state
@@ -200,7 +200,7 @@ GIT_EXTERN(int) git_stash_apply(
200
200
  */
201
201
  typedef int GIT_CALLBACK(git_stash_cb)(
202
202
  size_t index,
203
- const char* message,
203
+ const char *message,
204
204
  const git_oid *stash_id,
205
205
  void *payload);
206
206
 
@@ -29,9 +29,7 @@
29
29
  //
30
30
  ///////////////////////////////////////////////////////////////////////////////
31
31
 
32
- #ifndef _MSC_VER // [
33
- #error "Use this header only with Microsoft Visual C++ compilers!"
34
- #endif // _MSC_VER ]
32
+ #ifdef _MSC_VER // [
35
33
 
36
34
  #ifndef _MSC_STDINT_H_ // [
37
35
  #define _MSC_STDINT_H_
@@ -245,3 +243,5 @@ typedef uint64_t uintmax_t;
245
243
 
246
244
 
247
245
  #endif // _MSC_STDINT_H_ ]
246
+
247
+ #endif // _MSC_VER ]