rugged 0.22.2 → 0.23.0b1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rugged/rugged.c +1 -2
  3. data/ext/rugged/rugged_branch_collection.c +6 -44
  4. data/ext/rugged/rugged_config.c +7 -3
  5. data/ext/rugged/rugged_diff_delta.c +1 -1
  6. data/ext/rugged/rugged_diff_line.c +1 -1
  7. data/ext/rugged/rugged_object.c +2 -2
  8. data/ext/rugged/rugged_reference_collection.c +12 -56
  9. data/ext/rugged/rugged_remote.c +4 -33
  10. data/ext/rugged/rugged_remote_collection.c +1 -1
  11. data/ext/rugged/rugged_repo.c +10 -36
  12. data/ext/rugged/rugged_settings.c +3 -3
  13. data/ext/rugged/rugged_tree.c +1 -1
  14. data/lib/rugged/version.rb +1 -1
  15. data/vendor/libgit2/CMakeLists.txt +10 -3
  16. data/vendor/libgit2/COPYING +15 -21
  17. data/vendor/libgit2/include/git2/annotated_commit.h +20 -3
  18. data/vendor/libgit2/include/git2/branch.h +20 -16
  19. data/vendor/libgit2/include/git2/checkout.h +32 -18
  20. data/vendor/libgit2/include/git2/cherrypick.h +2 -2
  21. data/vendor/libgit2/include/git2/clone.h +4 -10
  22. data/vendor/libgit2/include/git2/config.h +66 -12
  23. data/vendor/libgit2/include/git2/describe.h +3 -2
  24. data/vendor/libgit2/include/git2/diff.h +3 -3
  25. data/vendor/libgit2/include/git2/errors.h +1 -0
  26. data/vendor/libgit2/include/git2/filter.h +21 -5
  27. data/vendor/libgit2/include/git2/index.h +32 -0
  28. data/vendor/libgit2/include/git2/merge.h +20 -3
  29. data/vendor/libgit2/include/git2/oid.h +1 -1
  30. data/vendor/libgit2/include/git2/pack.h +13 -0
  31. data/vendor/libgit2/include/git2/patch.h +3 -6
  32. data/vendor/libgit2/include/git2/rebase.h +8 -12
  33. data/vendor/libgit2/include/git2/refs.h +19 -29
  34. data/vendor/libgit2/include/git2/remote.h +5 -11
  35. data/vendor/libgit2/include/git2/repository.h +44 -15
  36. data/vendor/libgit2/include/git2/reset.h +19 -10
  37. data/vendor/libgit2/include/git2/revert.h +2 -2
  38. data/vendor/libgit2/include/git2/submodule.h +3 -9
  39. data/vendor/libgit2/include/git2/sys/config.h +3 -1
  40. data/vendor/libgit2/include/git2/sys/filter.h +10 -2
  41. data/vendor/libgit2/include/git2/sys/hashsig.h +49 -22
  42. data/vendor/libgit2/include/git2/transport.h +1 -1
  43. data/vendor/libgit2/include/git2/types.h +10 -3
  44. data/vendor/libgit2/include/git2/version.h +3 -2
  45. data/vendor/libgit2/src/annotated_commit.c +28 -0
  46. data/vendor/libgit2/src/array.h +19 -8
  47. data/vendor/libgit2/src/attr.c +95 -35
  48. data/vendor/libgit2/src/attr_file.c +51 -17
  49. data/vendor/libgit2/src/attr_file.h +37 -10
  50. data/vendor/libgit2/src/attrcache.c +13 -7
  51. data/vendor/libgit2/src/attrcache.h +1 -0
  52. data/vendor/libgit2/src/blame.c +26 -2
  53. data/vendor/libgit2/src/blame_git.c +6 -2
  54. data/vendor/libgit2/src/blob.c +6 -8
  55. data/vendor/libgit2/src/branch.c +55 -43
  56. data/vendor/libgit2/src/buf_text.c +13 -6
  57. data/vendor/libgit2/src/buffer.c +110 -25
  58. data/vendor/libgit2/src/buffer.h +18 -0
  59. data/vendor/libgit2/src/checkout.c +164 -92
  60. data/vendor/libgit2/src/checkout.h +0 -7
  61. data/vendor/libgit2/src/cherrypick.c +13 -7
  62. data/vendor/libgit2/src/clone.c +23 -25
  63. data/vendor/libgit2/src/commit.c +3 -3
  64. data/vendor/libgit2/src/common.h +23 -1
  65. data/vendor/libgit2/src/config.c +137 -19
  66. data/vendor/libgit2/src/config.h +2 -2
  67. data/vendor/libgit2/src/config_cache.c +2 -1
  68. data/vendor/libgit2/src/config_file.c +39 -18
  69. data/vendor/libgit2/src/config_file.h +1 -1
  70. data/vendor/libgit2/src/crlf.c +1 -1
  71. data/vendor/libgit2/src/delta-apply.c +3 -2
  72. data/vendor/libgit2/src/delta.c +25 -6
  73. data/vendor/libgit2/src/describe.c +2 -0
  74. data/vendor/libgit2/src/diff.c +8 -5
  75. data/vendor/libgit2/src/diff_driver.c +39 -18
  76. data/vendor/libgit2/src/diff_file.c +1 -1
  77. data/vendor/libgit2/src/diff_patch.c +12 -6
  78. data/vendor/libgit2/src/diff_tform.c +21 -24
  79. data/vendor/libgit2/src/filebuf.c +14 -12
  80. data/vendor/libgit2/src/fileops.c +61 -18
  81. data/vendor/libgit2/src/fileops.h +11 -2
  82. data/vendor/libgit2/src/filter.c +351 -99
  83. data/vendor/libgit2/src/filter.h +17 -0
  84. data/vendor/libgit2/src/global.c +38 -9
  85. data/vendor/libgit2/src/hash/hash_generic.c +1 -1
  86. data/vendor/libgit2/src/hashsig.c +28 -16
  87. data/vendor/libgit2/src/ignore.c +2 -2
  88. data/vendor/libgit2/src/index.c +159 -42
  89. data/vendor/libgit2/src/index.h +29 -0
  90. data/vendor/libgit2/src/indexer.c +11 -2
  91. data/vendor/libgit2/src/integer.h +96 -0
  92. data/vendor/libgit2/src/iterator.c +5 -3
  93. data/vendor/libgit2/src/khash.h +41 -29
  94. data/vendor/libgit2/src/merge.c +48 -35
  95. data/vendor/libgit2/src/merge.h +0 -1
  96. data/vendor/libgit2/src/merge_file.c +13 -0
  97. data/vendor/libgit2/src/mwindow.c +1 -1
  98. data/vendor/libgit2/src/notes.c +1 -1
  99. data/vendor/libgit2/src/odb.c +13 -11
  100. data/vendor/libgit2/src/odb_loose.c +22 -10
  101. data/vendor/libgit2/src/odb_mempack.c +4 -2
  102. data/vendor/libgit2/src/offmap.h +3 -2
  103. data/vendor/libgit2/src/oid.c +1 -1
  104. data/vendor/libgit2/src/oidmap.h +2 -1
  105. data/vendor/libgit2/src/openssl_stream.c +6 -3
  106. data/vendor/libgit2/src/pack-objects.c +273 -12
  107. data/vendor/libgit2/src/pack-objects.h +10 -0
  108. data/vendor/libgit2/src/pack.c +17 -6
  109. data/vendor/libgit2/src/pack.h +1 -3
  110. data/vendor/libgit2/src/path.c +68 -38
  111. data/vendor/libgit2/src/pathspec.c +3 -0
  112. data/vendor/libgit2/src/pool.c +9 -8
  113. data/vendor/libgit2/src/posix.c +11 -1
  114. data/vendor/libgit2/src/push.c +15 -17
  115. data/vendor/libgit2/src/push.h +1 -6
  116. data/vendor/libgit2/src/rebase.c +77 -35
  117. data/vendor/libgit2/src/refdb_fs.c +2 -2
  118. data/vendor/libgit2/src/refs.c +107 -81
  119. data/vendor/libgit2/src/refs.h +2 -2
  120. data/vendor/libgit2/src/refspec.c +3 -0
  121. data/vendor/libgit2/src/remote.c +19 -21
  122. data/vendor/libgit2/src/repository.c +258 -67
  123. data/vendor/libgit2/src/repository.h +31 -16
  124. data/vendor/libgit2/src/reset.c +28 -12
  125. data/vendor/libgit2/src/revert.c +12 -7
  126. data/vendor/libgit2/src/revwalk.c +3 -5
  127. data/vendor/libgit2/src/revwalk.h +1 -1
  128. data/vendor/libgit2/src/sortedcache.c +5 -3
  129. data/vendor/libgit2/src/stash.c +3 -5
  130. data/vendor/libgit2/src/strmap.h +2 -1
  131. data/vendor/libgit2/src/submodule.c +5 -6
  132. data/vendor/libgit2/src/tag.c +7 -5
  133. data/vendor/libgit2/src/transaction.c +1 -1
  134. data/vendor/libgit2/src/transports/cred.c +5 -2
  135. data/vendor/libgit2/src/transports/git.c +2 -3
  136. data/vendor/libgit2/src/transports/local.c +15 -34
  137. data/vendor/libgit2/src/transports/smart.c +1 -1
  138. data/vendor/libgit2/src/transports/smart_pkt.c +58 -18
  139. data/vendor/libgit2/src/transports/smart_protocol.c +2 -2
  140. data/vendor/libgit2/src/transports/winhttp.c +2 -2
  141. data/vendor/libgit2/src/tree.c +7 -5
  142. data/vendor/libgit2/src/tsort.c +3 -1
  143. data/vendor/libgit2/src/util.c +25 -0
  144. data/vendor/libgit2/src/util.h +31 -27
  145. data/vendor/libgit2/src/vector.c +2 -7
  146. data/vendor/libgit2/src/win32/dir.c +5 -3
  147. data/vendor/libgit2/src/win32/git2.rc +8 -4
  148. data/vendor/libgit2/src/win32/mingw-compat.h +7 -0
  149. data/vendor/libgit2/src/win32/msvc-compat.h +3 -0
  150. data/vendor/libgit2/src/win32/posix.h +1 -3
  151. data/vendor/libgit2/src/win32/posix_w32.c +31 -7
  152. data/vendor/libgit2/src/win32/utf-conv.c +1 -3
  153. data/vendor/libgit2/src/zstream.c +1 -1
  154. metadata +5 -5
  155. data/vendor/libgit2/src/bswap.h +0 -97
@@ -29,8 +29,8 @@ typedef struct {
29
29
  /** For merge commits, the "mainline" is treated as the parent. */
30
30
  unsigned int mainline;
31
31
 
32
- git_merge_options merge_opts; /*< Options for the merging */
33
- git_checkout_options checkout_opts; /*< Options for the checkout */
32
+ git_merge_options merge_opts; /**< Options for the merging */
33
+ git_checkout_options checkout_opts; /**< Options for the checkout */
34
34
  } git_cherrypick_options;
35
35
 
36
36
  #define GIT_CHERRYPICK_OPTIONS_VERSION 1
@@ -106,9 +106,7 @@ typedef struct git_clone_options {
106
106
  /**
107
107
  * These options are passed to the checkout step. To disable
108
108
  * checkout, set the `checkout_strategy` to
109
- * `GIT_CHECKOUT_NONE`. Generally you will want the use
110
- * GIT_CHECKOUT_SAFE_CREATE to create all files in the working
111
- * directory for the newly cloned repository.
109
+ * `GIT_CHECKOUT_NONE`.
112
110
  */
113
111
  git_checkout_options checkout_opts;
114
112
 
@@ -138,12 +136,6 @@ typedef struct git_clone_options {
138
136
  */
139
137
  const char* checkout_branch;
140
138
 
141
- /**
142
- * The identity used when updating the reflog. NULL means to
143
- * use the default signature using the config.
144
- */
145
- git_signature *signature;
146
-
147
139
  /**
148
140
  * A callback used to create the new repository into which to
149
141
  * clone. If NULL, the 'bare' field will be used to determine
@@ -173,7 +165,9 @@ typedef struct git_clone_options {
173
165
  } git_clone_options;
174
166
 
175
167
  #define GIT_CLONE_OPTIONS_VERSION 1
176
- #define GIT_CLONE_OPTIONS_INIT {GIT_CLONE_OPTIONS_VERSION, {GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE_CREATE}, GIT_REMOTE_CALLBACKS_INIT}
168
+ #define GIT_CLONE_OPTIONS_INIT { GIT_CLONE_OPTIONS_VERSION, \
169
+ { GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE }, \
170
+ GIT_REMOTE_CALLBACKS_INIT }
177
171
 
178
172
  /**
179
173
  * Initializes a `git_clone_options` with default values. Equivalent to
@@ -58,12 +58,19 @@ typedef enum {
58
58
  /**
59
59
  * An entry in a configuration file
60
60
  */
61
- typedef struct {
62
- const char *name; /*< Name of the entry (normalised) */
63
- const char *value; /*< String value of the entry */
64
- git_config_level_t level; /*< Which config file this was found in */
61
+ typedef struct git_config_entry {
62
+ const char *name; /**< Name of the entry (normalised) */
63
+ const char *value; /**< String value of the entry */
64
+ git_config_level_t level; /**< Which config file this was found in */
65
+ void (*free)(struct git_config_entry *entry); /**< Free function for this entry */
66
+ void *payload; /**< Opaque value for the free function. Do not read or write */
65
67
  } git_config_entry;
66
68
 
69
+ /**
70
+ * Free a config entry
71
+ */
72
+ GIT_EXTERN(void) git_config_entry_free(git_config_entry *);
73
+
67
74
  typedef int (*git_config_foreach_cb)(const git_config_entry *, void *);
68
75
  typedef struct git_config_iterator git_config_iterator;
69
76
 
@@ -261,16 +268,15 @@ GIT_EXTERN(void) git_config_free(git_config *cfg);
261
268
  /**
262
269
  * Get the git_config_entry of a config variable.
263
270
  *
264
- * The git_config_entry is owned by the config and should not be freed by the
265
- * user.
266
-
271
+ * Free the git_config_entry after use with `git_config_entry_free()`.
272
+ *
267
273
  * @param out pointer to the variable git_config_entry
268
274
  * @param cfg where to look for the variable
269
275
  * @param name the variable's name
270
276
  * @return 0 or an error code
271
277
  */
272
278
  GIT_EXTERN(int) git_config_get_entry(
273
- const git_config_entry **out,
279
+ git_config_entry **out,
274
280
  const git_config *cfg,
275
281
  const char *name);
276
282
 
@@ -319,24 +325,58 @@ GIT_EXTERN(int) git_config_get_int64(int64_t *out, const git_config *cfg, const
319
325
  */
320
326
  GIT_EXTERN(int) git_config_get_bool(int *out, const git_config *cfg, const char *name);
321
327
 
328
+ /**
329
+ * Get the value of a path config variable.
330
+ *
331
+ * A leading '~' will be expanded to the global search path (which
332
+ * defaults to the user's home directory but can be overridden via
333
+ * `git_libgit2_opts()`.
334
+ *
335
+ * All config files will be looked into, in the order of their
336
+ * defined level. A higher level means a higher priority. The
337
+ * first occurrence of the variable will be returned here.
338
+ *
339
+ * @param out the buffer in which to store the result
340
+ * @param cfg where to look for the variable
341
+ * @param name the variable's name
342
+ * @return 0 or an error code
343
+ */
344
+ GIT_EXTERN(int) git_config_get_path(git_buf *out, const git_config *cfg, const char *name);
345
+
322
346
  /**
323
347
  * Get the value of a string config variable.
324
348
  *
325
- * The string is owned by the variable and should not be freed by the
326
- * user. The pointer will be valid until the next operation on this
327
- * config object.
349
+ * This function can only be used on snapshot config objects. The
350
+ * string is owned by the config and should not be freed by the
351
+ * user. The pointer will be valid until the config is freed.
328
352
  *
329
353
  * All config files will be looked into, in the order of their
330
354
  * defined level. A higher level means a higher priority. The
331
355
  * first occurrence of the variable will be returned here.
332
356
  *
333
- * @param out pointer to the variable's value
357
+ * @param out pointer to the string
334
358
  * @param cfg where to look for the variable
335
359
  * @param name the variable's name
336
360
  * @return 0 or an error code
337
361
  */
338
362
  GIT_EXTERN(int) git_config_get_string(const char **out, const git_config *cfg, const char *name);
339
363
 
364
+ /**
365
+ * Get the value of a string config variable.
366
+ *
367
+ * The value of the config will be copied into the buffer.
368
+ *
369
+ * All config files will be looked into, in the order of their
370
+ * defined level. A higher level means a higher priority. The
371
+ * first occurrence of the variable will be returned here.
372
+ *
373
+ * @param out buffer in which to store the string
374
+ * @param cfg where to look for the variable
375
+ * @param name the variable's name
376
+ * @return 0 or an error code
377
+ */
378
+ GIT_EXTERN(int) git_config_get_string_buf(git_buf *out, const git_config *cfg, const char *name);
379
+
340
380
  /**
341
381
  * Get each value of a multivar in a foreach callback
342
382
  *
@@ -615,6 +655,20 @@ GIT_EXTERN(int) git_config_parse_int32(int32_t *out, const char *value);
615
655
  */
616
656
  GIT_EXTERN(int) git_config_parse_int64(int64_t *out, const char *value);
617
657
 
658
+ /**
659
+ * Parse a string value as a path.
660
+ *
661
+ * A leading '~' will be expanded to the global search path (which
662
+ * defaults to the user's home directory but can be overridden via
663
+ * `git_libgit2_opts()`.
664
+ *
665
+ * If the value does not begin with a tilde, the input will be
666
+ * returned.
667
+ *
668
+ * @param out placae to store the result of parsing
669
+ * @param value the path to evaluate
670
+ */
671
+ GIT_EXTERN(int) git_config_parse_path(git_buf *out, const char *value);
618
672
 
619
673
  /**
620
674
  * Perform an operation on each config variable in given config backend
@@ -129,7 +129,7 @@ GIT_EXTERN(int) git_describe_commit(
129
129
  * worktree. After peforming describe on HEAD, a status is run and the
130
130
  * description is considered to be dirty if there are.
131
131
  *
132
- * @param result pointer to store the result. You must free this once
132
+ * @param out pointer to store the result. You must free this once
133
133
  * you're done with it.
134
134
  * @param repo the repository in which to perform the describe
135
135
  * @param opts the lookup options
@@ -142,9 +142,10 @@ GIT_EXTERN(int) git_describe_workdir(
142
142
  /**
143
143
  * Print the describe result to a buffer
144
144
  *
145
+ * @param out The buffer to store the result
145
146
  * @param result the result from `git_describe_commit()` or
146
147
  * `git_describe_workdir()`.
147
- * @param opt the formatting options
148
+ * @param opts the formatting options
148
149
  */
149
150
  GIT_EXTERN(int) git_describe_format(
150
151
  git_buf *out,
@@ -849,9 +849,9 @@ GIT_EXTERN(size_t) git_diff_num_deltas_of_type(
849
849
  /**
850
850
  * Return the diff delta for an entry in the diff list.
851
851
  *
852
- * The `git_delta` pointer points to internal data and you do not have
853
- * to release it when you are done with it. It will go away when the
854
- * `git_diff` (or any associated `git_patch`) goes away.
852
+ * The `git_diff_delta` pointer points to internal data and you do not
853
+ * have to release it when you are done with it. It will go away when
854
+ * the * `git_diff` (or any associated `git_patch`) goes away.
855
855
  *
856
856
  * Note that the flags on the delta related to whether it has binary
857
857
  * content or not may not be set if there are no attributes set for the
@@ -93,6 +93,7 @@ typedef enum {
93
93
  GITERR_CHERRYPICK,
94
94
  GITERR_DESCRIBE,
95
95
  GITERR_REBASE,
96
+ GITERR_FILESYSTEM
96
97
  } git_error_t;
97
98
 
98
99
  /**
@@ -39,9 +39,9 @@ typedef enum {
39
39
  * Filter option flags.
40
40
  */
41
41
  typedef enum {
42
- GIT_FILTER_OPT_DEFAULT = 0u,
43
- GIT_FILTER_OPT_ALLOW_UNSAFE = (1u << 0),
44
- } git_filter_opt_t;
42
+ GIT_FILTER_DEFAULT = 0u,
43
+ GIT_FILTER_ALLOW_UNSAFE = (1u << 0),
44
+ } git_filter_flag_t;
45
45
 
46
46
  /**
47
47
  * A filter that can transform file data
@@ -83,7 +83,7 @@ typedef struct git_filter_list git_filter_list;
83
83
  * @param blob The blob to which the filter will be applied (if known)
84
84
  * @param path Relative path of the file to be filtered
85
85
  * @param mode Filtering direction (WT->ODB or ODB->WT)
86
- * @param options Combination of `git_filter_opt_t` flags
86
+ * @param flags Combination of `git_filter_flag_t` flags
87
87
  * @return 0 on success (which could still return NULL if no filters are
88
88
  * needed for the requested file), <0 on error
89
89
  */
@@ -93,7 +93,7 @@ GIT_EXTERN(int) git_filter_list_load(
93
93
  git_blob *blob, /* can be NULL */
94
94
  const char *path,
95
95
  git_filter_mode_t mode,
96
- uint32_t options);
96
+ uint32_t flags);
97
97
 
98
98
  /**
99
99
  * Apply filter list to a data buffer.
@@ -137,6 +137,22 @@ GIT_EXTERN(int) git_filter_list_apply_to_blob(
137
137
  git_filter_list *filters,
138
138
  git_blob *blob);
139
139
 
140
+ GIT_EXTERN(int) git_filter_list_stream_data(
141
+ git_filter_list *filters,
142
+ git_buf *data,
143
+ git_writestream *target);
144
+
145
+ GIT_EXTERN(int) git_filter_list_stream_file(
146
+ git_filter_list *filters,
147
+ git_repository *repo,
148
+ const char *path,
149
+ git_writestream *target);
150
+
151
+ GIT_EXTERN(int) git_filter_list_stream_blob(
152
+ git_filter_list *filters,
153
+ git_blob *blob,
154
+ git_writestream *target);
155
+
140
156
  /**
141
157
  * Free a git_filter_list
142
158
  *
@@ -456,6 +456,38 @@ GIT_EXTERN(int) git_index_entry_stage(const git_index_entry *entry);
456
456
  */
457
457
  GIT_EXTERN(int) git_index_add_bypath(git_index *index, const char *path);
458
458
 
459
+ /**
460
+ * Add or update an index entry from a buffer in memory
461
+ *
462
+ * This method will create a blob in the repository that owns the
463
+ * index and then add the index entry to the index. The `path` of the
464
+ * entry represents the position of the blob relative to the
465
+ * repository's root folder.
466
+ *
467
+ * If a previous index entry exists that has the same path as the
468
+ * given 'entry', it will be replaced. Otherwise, the 'entry' will be
469
+ * added. The `id` and the `file_size` of the 'entry' are updated with the
470
+ * real value of the blob.
471
+ *
472
+ * This forces the file to be added to the index, not looking
473
+ * at gitignore rules. Those rules can be evaluated through
474
+ * the git_status APIs (in status.h) before calling this.
475
+ *
476
+ * If this file currently is the result of a merge conflict, this
477
+ * file will no longer be marked as conflicting. The data about
478
+ * the conflict will be moved to the "resolve undo" (REUC) section.
479
+ *
480
+ * @param index an existing index object
481
+ * @param entry filename to add
482
+ * @param buffer data to be written into the blob
483
+ * @param len length of the data
484
+ * @return 0 or an error code
485
+ */
486
+ GIT_EXTERN(int) git_index_add_frombuffer(
487
+ git_index *index,
488
+ git_index_entry *entry,
489
+ const void *buffer, size_t len);
490
+
459
491
  /**
460
492
  * Remove an index entry corresponding to a file on disk
461
493
  *
@@ -63,7 +63,7 @@ GIT_EXTERN(int) git_merge_file_init_input(
63
63
 
64
64
  /**
65
65
  * Flags for `git_merge_tree` options. A combination of these flags can be
66
- * passed in via the `flags` value in the `git_merge_options`.
66
+ * passed in via the `tree_flags` value in the `git_merge_options`.
67
67
  */
68
68
  typedef enum {
69
69
  /**
@@ -125,6 +125,21 @@ typedef enum {
125
125
 
126
126
  /** Condense non-alphanumeric regions for simplified diff file */
127
127
  GIT_MERGE_FILE_SIMPLIFY_ALNUM = (1 << 2),
128
+
129
+ /** Ignore all whitespace */
130
+ GIT_MERGE_FILE_IGNORE_WHITESPACE = (1 << 3),
131
+
132
+ /** Ignore changes in amount of whitespace */
133
+ GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE = (1 << 4),
134
+
135
+ /** Ignore whitespace at end of line */
136
+ GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL = (1 << 5),
137
+
138
+ /** Use the "patience diff" algorithm */
139
+ GIT_MERGE_FILE_DIFF_PATIENCE = (1 << 6),
140
+
141
+ /** Take extra time to find minimal diff */
142
+ GIT_MERGE_FILE_DIFF_MINIMAL = (1 << 7),
128
143
  } git_merge_file_flags_t;
129
144
 
130
145
  /**
@@ -155,7 +170,7 @@ typedef struct {
155
170
  git_merge_file_favor_t favor;
156
171
 
157
172
  /** Merge file flags. */
158
- git_merge_file_flags_t flags;
173
+ unsigned int flags;
159
174
  } git_merge_file_options;
160
175
 
161
176
  #define GIT_MERGE_FILE_OPTIONS_VERSION 1
@@ -205,7 +220,7 @@ typedef struct {
205
220
  */
206
221
  typedef struct {
207
222
  unsigned int version;
208
- git_merge_tree_flag_t flags;
223
+ git_merge_tree_flag_t tree_flags;
209
224
 
210
225
  /**
211
226
  * Similarity to consider a file renamed (default 50). If
@@ -230,6 +245,8 @@ typedef struct {
230
245
 
231
246
  /** Flags for handling conflicting content. */
232
247
  git_merge_file_favor_t file_favor;
248
+
249
+ unsigned int file_flags;
233
250
  } git_merge_options;
234
251
 
235
252
  #define GIT_MERGE_OPTIONS_VERSION 1
@@ -123,7 +123,7 @@ GIT_EXTERN(void) git_oid_pathfmt(char *out, const git_oid *id);
123
123
  * will be stored in TLS (i.e. one buffer per thread) to allow for
124
124
  * concurrent calls of the function.
125
125
  *
126
- * @param id the oid structure to format
126
+ * @param oid The oid structure to format
127
127
  * @return the c-string
128
128
  */
129
129
  GIT_EXTERN(char *) git_oid_tostr_s(const git_oid *oid);
@@ -114,6 +114,19 @@ GIT_EXTERN(int) git_packbuilder_insert_tree(git_packbuilder *pb, const git_oid *
114
114
  */
115
115
  GIT_EXTERN(int) git_packbuilder_insert_commit(git_packbuilder *pb, const git_oid *id);
116
116
 
117
+ /**
118
+ * Insert objects as given by the walk
119
+ *
120
+ * Those commits and all objects they reference will be inserted into
121
+ * the packbuilder.
122
+ *
123
+ * @param pb the packbuilder
124
+ * @param walk the revwalk to use to fill the packbuilder
125
+ *
126
+ * @return 0 or an error code
127
+ */
128
+ GIT_EXTERN(int) git_packbuilder_insert_walk(git_packbuilder *pb, git_revwalk *walk);
129
+
117
130
  /**
118
131
  * Write the contents of the packfile to an in-memory buffer
119
132
  *
@@ -29,7 +29,7 @@ GIT_BEGIN_DECL
29
29
  typedef struct git_patch git_patch;
30
30
 
31
31
  /**
32
- * Return the diff delta and patch for an entry in the diff list.
32
+ * Return a patch for an entry in the diff list.
33
33
  *
34
34
  * The `git_patch` is a newly created object contains the text diffs
35
35
  * for the delta. You have to call `git_patch_free()` when you are
@@ -40,10 +40,6 @@ typedef struct git_patch git_patch;
40
40
  * created, the output will be set to NULL, and the `binary` flag will be
41
41
  * set true in the `git_diff_delta` structure.
42
42
  *
43
- * The `git_diff_delta` pointer points to internal data and you do not have
44
- * to release it when you are done with it. It will go away when the
45
- * `git_diff` and `git_patch` go away.
46
- *
47
43
  * It is okay to pass NULL for either of the output parameters; if you pass
48
44
  * NULL for the `git_patch`, then the text diff will not be calculated.
49
45
  *
@@ -139,7 +135,8 @@ GIT_EXTERN(int) git_patch_from_buffers(
139
135
  GIT_EXTERN(void) git_patch_free(git_patch *patch);
140
136
 
141
137
  /**
142
- * Get the delta associated with a patch
138
+ * Get the delta associated with a patch. This delta points to internal
139
+ * data and you do not have to release it when you are done with it.
143
140
  */
144
141
  GIT_EXTERN(const git_diff_delta *) git_patch_get_delta(const git_patch *patch);
145
142
 
@@ -133,12 +133,12 @@ GIT_EXTERN(int) git_rebase_init_options(
133
133
  *
134
134
  * @param out Pointer to store the rebase object
135
135
  * @param repo The repository to perform the rebase
136
- * @param branch The terminal commit to rebase
136
+ * @param branch The terminal commit to rebase, or NULL to rebase the
137
+ * current branch
137
138
  * @param upstream The commit to begin rebasing from, or NULL to rebase all
138
139
  * reachable commits
139
140
  * @param onto The branch to rebase onto, or NULL to rebase onto the given
140
141
  * upstream
141
- * @param signature The signature of the rebaser (optional)
142
142
  * @param opts Options to specify how rebase is performed
143
143
  * @return Zero on success; -1 on failure.
144
144
  */
@@ -148,7 +148,6 @@ GIT_EXTERN(int) git_rebase_init(
148
148
  const git_annotated_commit *branch,
149
149
  const git_annotated_commit *upstream,
150
150
  const git_annotated_commit *onto,
151
- const git_signature *signature,
152
151
  const git_rebase_options *opts);
153
152
 
154
153
  /**
@@ -156,7 +155,7 @@ GIT_EXTERN(int) git_rebase_init(
156
155
  * invocation of `git_rebase_init` or by another client.
157
156
  *
158
157
  * @param out Pointer to store the rebase object
159
- * @param reop The repository that has a rebase in-progress
158
+ * @param repo The repository that has a rebase in-progress
160
159
  * @return Zero on success; -1 on failure.
161
160
  */
162
161
  GIT_EXTERN(int) git_rebase_open(git_rebase **out, git_repository *repo);
@@ -195,8 +194,8 @@ GIT_EXTERN(git_rebase_operation *) git_rebase_operation_byindex(
195
194
  * working directory will be updated with the changes. If there are conflicts,
196
195
  * you will need to address those before committing the changes.
197
196
  *
198
- * @param out Pointer to store the rebase operation that is to be performed next
199
- * @param repo The rebase in progress
197
+ * @param operation Pointer to store the rebase operation that is to be performed next
198
+ * @param rebase The rebase in progress
200
199
  * @param checkout_opts Options to specify how the patch should be checked out
201
200
  * @return Zero on success; -1 on failure.
202
201
  */
@@ -211,7 +210,7 @@ GIT_EXTERN(int) git_rebase_next(
211
210
  * invocation.
212
211
  *
213
212
  * @param id Pointer in which to store the OID of the newly created commit
214
- * @param repo The rebase that is in-progress
213
+ * @param rebase The rebase that is in-progress
215
214
  * @param author The author of the updated commit, or NULL to keep the
216
215
  * author from the original commit
217
216
  * @param committer The committer of the rebase
@@ -240,13 +239,10 @@ GIT_EXTERN(int) git_rebase_commit(
240
239
  * and working directory to their state before rebase began.
241
240
  *
242
241
  * @param rebase The rebase that is in-progress
243
- * @param signature The identity that is aborting the rebase
244
242
  * @return Zero on success; GIT_ENOTFOUND if a rebase is not in progress,
245
243
  * -1 on other errors.
246
244
  */
247
- GIT_EXTERN(int) git_rebase_abort(
248
- git_rebase *rebase,
249
- const git_signature *signature);
245
+ GIT_EXTERN(int) git_rebase_abort(git_rebase *rebase);
250
246
 
251
247
  /**
252
248
  * Finishes a rebase that is currently in progress once all patches have
@@ -255,7 +251,7 @@ GIT_EXTERN(int) git_rebase_abort(
255
251
  * @param rebase The rebase that is in-progress
256
252
  * @param signature The identity that is finishing the rebase (optional)
257
253
  * @param opts Options to specify how rebase is finished
258
- * @param Zero on success; -1 on error
254
+ * @return Zero on success; -1 on error
259
255
  */
260
256
  GIT_EXTERN(int) git_rebase_finish(
261
257
  git_rebase *rebase,