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
@@ -89,9 +89,9 @@ GIT_EXTERN(int) git_reference_dwim(git_reference **out, git_repository *repo, co
89
89
  * This function will return an error if a reference already exists with the
90
90
  * given name unless `force` is true, in which case it will be overwritten.
91
91
  *
92
- * The signature and message for the reflog will be ignored if the
93
- * reference does not belong in the standard set (HEAD, branches and
94
- * remote-tracking branches) and it does not have a reflog.
92
+ * The message for the reflog will be ignored if the reference does
93
+ * not belong in the standard set (HEAD, branches and remote-tracking
94
+ * branches) and it does not have a reflog.
95
95
  *
96
96
  * It will return GIT_EMODIFIED if the reference's value at the time
97
97
  * of updating does not match the one passed through `current_value`
@@ -103,11 +103,10 @@ GIT_EXTERN(int) git_reference_dwim(git_reference **out, git_repository *repo, co
103
103
  * @param target The target of the reference
104
104
  * @param force Overwrite existing references
105
105
  * @param current_value The expected value of the reference when updating
106
- * @param signature The identity that will used to populate the reflog entry
107
106
  * @param log_message The one line long message to be appended to the reflog
108
107
  * @return 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC, GIT_EMODIFIED or an error code
109
108
  */
110
- GIT_EXTERN(int) git_reference_symbolic_create_matching(git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *current_value, const git_signature *signature, const char *log_message);
109
+ GIT_EXTERN(int) git_reference_symbolic_create_matching(git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *current_value, const char *log_message);
111
110
 
112
111
  /**
113
112
  * Create a new symbolic reference.
@@ -131,20 +130,19 @@ GIT_EXTERN(int) git_reference_symbolic_create_matching(git_reference **out, git_
131
130
  * This function will return an error if a reference already exists with the
132
131
  * given name unless `force` is true, in which case it will be overwritten.
133
132
  *
134
- * The signature and message for the reflog will be ignored if the
135
- * reference does not belong in the standard set (HEAD, branches and
136
- * remote-tracking branches) and it does not have a reflog.
133
+ * The message for the reflog will be ignored if the reference does
134
+ * not belong in the standard set (HEAD, branches and remote-tracking
135
+ * branches) and it does not have a reflog.
137
136
  *
138
137
  * @param out Pointer to the newly created reference
139
138
  * @param repo Repository where that reference will live
140
139
  * @param name The name of the reference
141
140
  * @param target The target of the reference
142
141
  * @param force Overwrite existing references
143
- * @param signature The identity that will used to populate the reflog entry
144
142
  * @param log_message The one line long message to be appended to the reflog
145
143
  * @return 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code
146
144
  */
147
- GIT_EXTERN(int) git_reference_symbolic_create(git_reference **out, git_repository *repo, const char *name, const char *target, int force, const git_signature *signature, const char *log_message);
145
+ GIT_EXTERN(int) git_reference_symbolic_create(git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *log_message);
148
146
 
149
147
  /**
150
148
  * Create a new direct reference.
@@ -169,20 +167,19 @@ GIT_EXTERN(int) git_reference_symbolic_create(git_reference **out, git_repositor
169
167
  * This function will return an error if a reference already exists with the
170
168
  * given name unless `force` is true, in which case it will be overwritten.
171
169
  *
172
- * The signature and message for the reflog will be ignored if the
173
- * reference does not belong in the standard set (HEAD, branches and
174
- * remote-tracking branches) and and it does not have a reflog.
170
+ * The message for the reflog will be ignored if the reference does
171
+ * not belong in the standard set (HEAD, branches and remote-tracking
172
+ * branches) and and it does not have a reflog.
175
173
  *
176
174
  * @param out Pointer to the newly created reference
177
175
  * @param repo Repository where that reference will live
178
176
  * @param name The name of the reference
179
177
  * @param id The object id pointed to by the reference.
180
178
  * @param force Overwrite existing references
181
- * @param signature The identity that will used to populate the reflog entry
182
179
  * @param log_message The one line long message to be appended to the reflog
183
180
  * @return 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code
184
181
  */
185
- GIT_EXTERN(int) git_reference_create(git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const git_signature *signature, const char *log_message);
182
+ GIT_EXTERN(int) git_reference_create(git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const char *log_message);
186
183
 
187
184
  /**
188
185
  * Conditionally create new direct reference
@@ -207,9 +204,9 @@ GIT_EXTERN(int) git_reference_create(git_reference **out, git_repository *repo,
207
204
  * This function will return an error if a reference already exists with the
208
205
  * given name unless `force` is true, in which case it will be overwritten.
209
206
  *
210
- * The signature and message for the reflog will be ignored if the
211
- * reference does not belong in the standard set (HEAD, branches and
212
- * remote-tracking branches) and and it does not have a reflog.
207
+ * The message for the reflog will be ignored if the reference does
208
+ * not belong in the standard set (HEAD, branches and remote-tracking
209
+ * branches) and and it does not have a reflog.
213
210
  *
214
211
  * It will return GIT_EMODIFIED if the reference's value at the time
215
212
  * of updating does not match the one passed through `current_id`
@@ -221,12 +218,11 @@ GIT_EXTERN(int) git_reference_create(git_reference **out, git_repository *repo,
221
218
  * @param id The object id pointed to by the reference.
222
219
  * @param force Overwrite existing references
223
220
  * @param current_id The expected value of the reference at the time of update
224
- * @param signature The identity that will used to populate the reflog entry
225
221
  * @param log_message The one line long message to be appended to the reflog
226
222
  * @return 0 on success, GIT_EMODIFIED if the value of the reference
227
223
  * has changed, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code
228
224
  */
229
- GIT_EXTERN(int) git_reference_create_matching(git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const git_oid *current_id, const git_signature *signature, const char *log_message);
225
+ GIT_EXTERN(int) git_reference_create_matching(git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const git_oid *current_id, const char *log_message);
230
226
 
231
227
  /**
232
228
  * Get the OID pointed to by a direct reference.
@@ -320,14 +316,13 @@ GIT_EXTERN(git_repository *) git_reference_owner(const git_reference *ref);
320
316
  * The target name will be checked for validity.
321
317
  * See `git_reference_symbolic_create()` for rules about valid names.
322
318
  *
323
- * The signature and message for the reflog will be ignored if the
324
- * reference does not belong in the standard set (HEAD, branches and
325
- * remote-tracking branches) and and it does not have a reflog.
319
+ * The message for the reflog will be ignored if the reference does
320
+ * not belong in the standard set (HEAD, branches and remote-tracking
321
+ * branches) and and it does not have a reflog.
326
322
  *
327
323
  * @param out Pointer to the newly created reference
328
324
  * @param ref The reference
329
325
  * @param target The new target for the reference
330
- * @param signature The identity that will used to populate the reflog entry
331
326
  * @param log_message The one line long message to be appended to the reflog
332
327
  * @return 0 on success, GIT_EINVALIDSPEC or an error code
333
328
  */
@@ -335,7 +330,6 @@ GIT_EXTERN(int) git_reference_symbolic_set_target(
335
330
  git_reference **out,
336
331
  git_reference *ref,
337
332
  const char *target,
338
- const git_signature *signature,
339
333
  const char *log_message);
340
334
 
341
335
  /**
@@ -348,7 +342,6 @@ GIT_EXTERN(int) git_reference_symbolic_set_target(
348
342
  * @param out Pointer to the newly created reference
349
343
  * @param ref The reference
350
344
  * @param id The new target OID for the reference
351
- * @param signature The identity that will used to populate the reflog entry
352
345
  * @param log_message The one line long message to be appended to the reflog
353
346
  * @return 0 on success, GIT_EMODIFIED if the value of the reference
354
347
  * has changed since it was read, or an error code
@@ -357,7 +350,6 @@ GIT_EXTERN(int) git_reference_set_target(
357
350
  git_reference **out,
358
351
  git_reference *ref,
359
352
  const git_oid *id,
360
- const git_signature *signature,
361
353
  const char *log_message);
362
354
 
363
355
  /**
@@ -379,7 +371,6 @@ GIT_EXTERN(int) git_reference_set_target(
379
371
  * @param ref The reference to rename
380
372
  * @param new_name The new name for the reference
381
373
  * @param force Overwrite an existing reference
382
- * @param signature The identity that will used to populate the reflog entry
383
374
  * @param log_message The one line long message to be appended to the reflog
384
375
  * @return 0 on success, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code
385
376
  *
@@ -389,7 +380,6 @@ GIT_EXTERN(int) git_reference_rename(
389
380
  git_reference *ref,
390
381
  const char *new_name,
391
382
  int force,
392
- const git_signature *signature,
393
383
  const char *log_message);
394
384
 
395
385
  /**
@@ -376,15 +376,14 @@ GIT_EXTERN(void) git_remote_free(git_remote *remote);
376
376
  * Update the tips to the new state
377
377
  *
378
378
  * @param remote the remote to update
379
- * @param signature The identity to use when updating reflogs
380
- * @param reflog_message The message to insert into the reflogs. If NULL, the
381
- * default is "fetch <name>", where <name> is the name of
382
- * the remote (or its url, for in-memory remotes).
379
+ * @param reflog_message The message to insert into the reflogs. If
380
+ * NULL and fetching, the default is "fetch <name>", where <name> is
381
+ * the name of the remote (or its url, for in-memory remotes). This
382
+ * parameter is ignored when pushing.
383
383
  * @return 0 or an error code
384
384
  */
385
385
  GIT_EXTERN(int) git_remote_update_tips(
386
386
  git_remote *remote,
387
- const git_signature *signature,
388
387
  const char *reflog_message);
389
388
 
390
389
  /**
@@ -404,7 +403,6 @@ GIT_EXTERN(int) git_remote_prune(git_remote *remote);
404
403
  * @param remote the remote to fetch from
405
404
  * @param refspecs the refspecs to use for this fetch. Pass NULL or an
406
405
  * empty array to use the base refspecs.
407
- * @param signature The identity to use when updating reflogs
408
406
  * @param reflog_message The message to insert into the reflogs. If NULL, the
409
407
  * default is "fetch"
410
408
  * @return 0 or an error code
@@ -412,7 +410,6 @@ GIT_EXTERN(int) git_remote_prune(git_remote *remote);
412
410
  GIT_EXTERN(int) git_remote_fetch(
413
411
  git_remote *remote,
414
412
  const git_strarray *refspecs,
415
- const git_signature *signature,
416
413
  const char *reflog_message);
417
414
 
418
415
  /**
@@ -424,13 +421,10 @@ GIT_EXTERN(int) git_remote_fetch(
424
421
  * @param refspecs the refspecs to use for pushing. If none are
425
422
  * passed, the configured refspecs will be used
426
423
  * @param opts the options
427
- * @param signature signature to use for the reflog of updated references
428
- * @param reflog_message message to use for the reflog of upated references
429
424
  */
430
425
  GIT_EXTERN(int) git_remote_push(git_remote *remote,
431
426
  const git_strarray *refspecs,
432
- const git_push_options *opts,
433
- const git_signature *signature, const char *reflog_message);
427
+ const git_push_options *opts);
434
428
 
435
429
  /**
436
430
  * Get a list of the configured remotes for a repo
@@ -603,15 +603,11 @@ GIT_EXTERN(int) git_repository_hashfile(
603
603
  *
604
604
  * @param repo Repository pointer
605
605
  * @param refname Canonical name of the reference the HEAD should point at
606
- * @param signature The identity that will used to populate the reflog entry
607
- * @param log_message The one line long message to be appended to the reflog
608
606
  * @return 0 on success, or an error code
609
607
  */
610
608
  GIT_EXTERN(int) git_repository_set_head(
611
609
  git_repository* repo,
612
- const char* refname,
613
- const git_signature *signature,
614
- const char *log_message);
610
+ const char* refname);
615
611
 
616
612
  /**
617
613
  * Make the repository HEAD directly point to the Commit.
@@ -627,15 +623,27 @@ GIT_EXTERN(int) git_repository_set_head(
627
623
  *
628
624
  * @param repo Repository pointer
629
625
  * @param commitish Object id of the Commit the HEAD should point to
630
- * @param signature The identity that will used to populate the reflog entry
631
- * @param log_message The one line long message to be appended to the reflog
632
626
  * @return 0 on success, or an error code
633
627
  */
634
628
  GIT_EXTERN(int) git_repository_set_head_detached(
635
629
  git_repository* repo,
636
- const git_oid* commitish,
637
- const git_signature *signature,
638
- const char *log_message);
630
+ const git_oid* commitish);
631
+
632
+ /**
633
+ * Make the repository HEAD directly point to the Commit.
634
+ *
635
+ * This behaves like `git_repository_set_head_detached()` but takes an
636
+ * annotated commit, which lets you specify which extended sha syntax
637
+ * string was specified by a user, allowing for more exact reflog
638
+ * messages.
639
+ *
640
+ * See the documentation for `git_repository_set_head_detached()`.
641
+ *
642
+ * @see git_repository_set_head_detached
643
+ */
644
+ GIT_EXTERN(int) git_repository_set_head_detached_from_annotated(
645
+ git_repository *repo,
646
+ const git_annotated_commit *commitish);
639
647
 
640
648
  /**
641
649
  * Detach the HEAD.
@@ -651,15 +659,11 @@ GIT_EXTERN(int) git_repository_set_head_detached(
651
659
  * Otherwise, the HEAD will be detached and point to the peeled Commit.
652
660
  *
653
661
  * @param repo Repository pointer
654
- * @param signature The identity that will used to populate the reflog entry
655
- * @param reflog_message The one line long message to be appended to the reflog
656
662
  * @return 0 on success, GIT_EUNBORNBRANCH when HEAD points to a non existing
657
663
  * branch or an error code
658
664
  */
659
665
  GIT_EXTERN(int) git_repository_detach_head(
660
- git_repository* repo,
661
- const git_signature *signature,
662
- const char *reflog_message);
666
+ git_repository* repo);
663
667
 
664
668
  /**
665
669
  * Repository state
@@ -720,6 +724,31 @@ GIT_EXTERN(const char *) git_repository_get_namespace(git_repository *repo);
720
724
  */
721
725
  GIT_EXTERN(int) git_repository_is_shallow(git_repository *repo);
722
726
 
727
+ /**
728
+ * Retrieve the configured identity to use for reflogs
729
+ *
730
+ * The memory is owned by the repository and must not be freed by the
731
+ * user.
732
+ *
733
+ * @param name where to store the pointer to the name
734
+ * @param email where to store the pointer to the email
735
+ * @param repo the repository
736
+ */
737
+ GIT_EXTERN(int) git_repository_ident(const char **name, const char **email, const git_repository *repo);
738
+
739
+ /**
740
+ * Set the identity to be used for writing reflogs
741
+ *
742
+ * If both are set, this name and email will be used to write to the
743
+ * reflog. Pass NULL to unset. When unset, the identity will be taken
744
+ * from the repository's configuration.
745
+ *
746
+ * @param repo the repository to configure
747
+ * @param name the name to use for the reflog entries
748
+ * @param name the email to use for the reflog entries
749
+ */
750
+ GIT_EXTERN(int) git_repository_set_ident(git_repository *repo, const char *name, const char *email);
751
+
723
752
  /** @} */
724
753
  GIT_END_DECL
725
754
  #endif
@@ -56,22 +56,31 @@ typedef enum {
56
56
  * The checkout_strategy field will be overridden (based on reset_type).
57
57
  * This parameter can be used to propagate notify and progress callbacks.
58
58
  *
59
- * @param signature The identity that will used to populate the reflog entry
60
- *
61
- * @param log_message The one line long message to be appended to the reflog.
62
- * The reflog is only updated if the affected direct reference is actually
63
- * changing. If NULL, the default is "reset: moving"; if you want something more
64
- * useful, provide a message.
65
- *
66
59
  * @return 0 on success or an error code
67
60
  */
68
61
  GIT_EXTERN(int) git_reset(
69
62
  git_repository *repo,
70
63
  git_object *target,
71
64
  git_reset_t reset_type,
72
- git_checkout_options *checkout_opts,
73
- const git_signature *signature,
74
- const char *log_message);
65
+ git_checkout_options *checkout_opts);
66
+
67
+ /**
68
+ * Sets the current head to the specified commit oid and optionally
69
+ * resets the index and working tree to match.
70
+ *
71
+ * This behaves like `git_reset()` but takes an annotated commit,
72
+ * which lets you specify which extended sha syntax string was
73
+ * specified by a user, allowing for more exact reflog messages.
74
+ *
75
+ * See the documentation for `git_reset()`.
76
+ *
77
+ * @see git_reset
78
+ */
79
+ GIT_EXTERN(int) git_reset_from_annotated(
80
+ git_repository *repo,
81
+ git_annotated_commit *commit,
82
+ git_reset_t reset_type,
83
+ git_checkout_options *checkout_opts);
75
84
 
76
85
  /**
77
86
  * Updates some entries in the index from the target commit tree.
@@ -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_revert_options;
35
35
 
36
36
  #define GIT_REVERT_OPTIONS_VERSION 1
@@ -137,23 +137,17 @@ typedef struct git_submodule_update_options {
137
137
 
138
138
  /**
139
139
  * The checkout strategy to use when the sub repository needs to
140
- * be cloned. Use GIT_CHECKOUT_SAFE_CREATE to create all files
140
+ * be cloned. Use GIT_CHECKOUT_SAFE to create all files
141
141
  * in the working directory for the newly cloned repository.
142
142
  */
143
143
  unsigned int clone_checkout_strategy;
144
-
145
- /**
146
- * The identity used when updating the reflog. NULL means to
147
- * use the default signature using the config.
148
- */
149
- git_signature *signature;
150
144
  } git_submodule_update_options;
151
145
 
152
146
  #define GIT_SUBMODULE_UPDATE_OPTIONS_VERSION 1
153
147
  #define GIT_SUBMODULE_UPDATE_OPTIONS_INIT \
154
148
  { GIT_CHECKOUT_OPTIONS_VERSION, \
155
- { GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE}, \
156
- GIT_REMOTE_CALLBACKS_INIT, GIT_CHECKOUT_SAFE_CREATE }
149
+ { GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE }, \
150
+ GIT_REMOTE_CALLBACKS_INIT, GIT_CHECKOUT_SAFE }
157
151
 
158
152
  /**
159
153
  * Initializes a `git_submodule_update_options` with default values.
@@ -53,11 +53,13 @@ struct git_config_iterator {
53
53
  */
54
54
  struct git_config_backend {
55
55
  unsigned int version;
56
+ /** True if this backend is for a snapshot */
57
+ int readonly;
56
58
  struct git_config *cfg;
57
59
 
58
60
  /* Open means open the file/database and parse if necessary */
59
61
  int (*open)(struct git_config_backend *, git_config_level_t level);
60
- int (*get)(struct git_config_backend *, const char *key, const git_config_entry **entry);
62
+ int (*get)(struct git_config_backend *, const char *key, git_config_entry **entry);
61
63
  int (*set)(struct git_config_backend *, const char *key, const char *value);
62
64
  int (*set_multivar)(git_config_backend *cfg, const char *name, const char *regexp, const char *value);
63
65
  int (*del)(struct git_config_backend *, const char *key);
@@ -123,9 +123,9 @@ GIT_EXTERN(const git_oid *) git_filter_source_id(const git_filter_source *src);
123
123
  GIT_EXTERN(git_filter_mode_t) git_filter_source_mode(const git_filter_source *src);
124
124
 
125
125
  /**
126
- * Get the combination git_filter_opt_t options to be applied
126
+ * Get the combination git_filter_flag_t options to be applied
127
127
  */
128
- GIT_EXTERN(uint32_t) git_filter_source_options(const git_filter_source *src);
128
+ GIT_EXTERN(uint32_t) git_filter_source_flags(const git_filter_source *src);
129
129
 
130
130
  /*
131
131
  * struct git_filter
@@ -208,6 +208,13 @@ typedef int (*git_filter_apply_fn)(
208
208
  const git_buf *from,
209
209
  const git_filter_source *src);
210
210
 
211
+ typedef int (*git_filter_stream_fn)(
212
+ git_writestream **out,
213
+ git_filter *self,
214
+ void **payload,
215
+ const git_filter_source *src,
216
+ git_writestream *next);
217
+
211
218
  /**
212
219
  * Callback to clean up after filtering has been applied
213
220
  *
@@ -247,6 +254,7 @@ struct git_filter {
247
254
  git_filter_shutdown_fn shutdown;
248
255
  git_filter_check_fn check;
249
256
  git_filter_apply_fn apply;
257
+ git_filter_stream_fn stream;
250
258
  git_filter_cleanup_fn cleanup;
251
259
  };
252
260
 
@@ -12,33 +12,52 @@
12
12
  GIT_BEGIN_DECL
13
13
 
14
14
  /**
15
- * Similarity signature of line hashes for a buffer
15
+ * Similarity signature of arbitrary text content based on line hashes
16
16
  */
17
17
  typedef struct git_hashsig git_hashsig;
18
18
 
19
19
  /**
20
- * Options for hashsig calculation
20
+ * Options for hashsig computation
21
+ *
22
+ * The options GIT_HASHSIG_NORMAL, GIT_HASHSIG_IGNORE_WHITESPACE,
23
+ * GIT_HASHSIG_SMART_WHITESPACE are exclusive and should not be combined.
21
24
  */
22
25
  typedef enum {
23
- GIT_HASHSIG_NORMAL = 0, /* use all data */
24
- GIT_HASHSIG_IGNORE_WHITESPACE = 1, /* ignore whitespace */
25
- GIT_HASHSIG_SMART_WHITESPACE = 2, /* ignore \r and all space after \n */
26
+ /**
27
+ * Use all data
28
+ */
29
+ GIT_HASHSIG_NORMAL = 0,
30
+
31
+ /**
32
+ * Ignore whitespace
33
+ */
34
+ GIT_HASHSIG_IGNORE_WHITESPACE = (1 << 0),
35
+
36
+ /**
37
+ * Ignore \r and all space after \n
38
+ */
39
+ GIT_HASHSIG_SMART_WHITESPACE = (1 << 1),
40
+
41
+ /**
42
+ * Allow hashing of small files
43
+ */
44
+ GIT_HASHSIG_ALLOW_SMALL_FILES = (1 << 2)
26
45
  } git_hashsig_option_t;
27
46
 
28
47
  /**
29
- * Build a similarity signature for a buffer
30
- *
31
- * If you have passed a whitespace-ignoring buffer, then the whitespace
32
- * will be removed from the buffer while it is being processed, modifying
33
- * the buffer in place. Sorry about that!
48
+ * Compute a similarity signature for a text buffer
34
49
  *
35
- * This will return an error if the buffer doesn't contain enough data to
36
- * compute a valid signature.
50
+ * If you have passed the option GIT_HASHSIG_IGNORE_WHITESPACE, then the
51
+ * whitespace will be removed from the buffer while it is being processed,
52
+ * modifying the buffer in place. Sorry about that!
37
53
  *
38
- * @param out The array of hashed runs representing the file content
39
- * @param buf The contents of the file to hash
40
- * @param buflen The length of the data at `buf`
41
- * @param generate_pairwise_hashes Should pairwise runs be hashed
54
+ * @param out The computed similarity signature.
55
+ * @param buf The input buffer.
56
+ * @param buflen The input buffer size.
57
+ * @param opts The signature computation options (see above).
58
+ * @return 0 on success, GIT_EBUFS if the buffer doesn't contain enough data to
59
+ * compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or
60
+ * error code.
42
61
  */
43
62
  GIT_EXTERN(int) git_hashsig_create(
44
63
  git_hashsig **out,
@@ -47,13 +66,17 @@ GIT_EXTERN(int) git_hashsig_create(
47
66
  git_hashsig_option_t opts);
48
67
 
49
68
  /**
50
- * Build a similarity signature from a file
69
+ * Compute a similarity signature for a text file
51
70
  *
52
71
  * This walks through the file, only loading a maximum of 4K of file data at
53
- * a time. Otherwise, it acts just like `git_hashsig_create`.
72
+ * a time. Otherwise, it acts just like `git_hashsig_create`.
54
73
  *
55
- * This will return an error if the file doesn't contain enough data to
56
- * compute a valid signature.
74
+ * @param out The computed similarity signature.
75
+ * @param path The path to the input file.
76
+ * @param opts The signature computation options (see above).
77
+ * @return 0 on success, GIT_EBUFS if the buffer doesn't contain enough data to
78
+ * compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or
79
+ * error code.
57
80
  */
58
81
  GIT_EXTERN(int) git_hashsig_create_fromfile(
59
82
  git_hashsig **out,
@@ -62,13 +85,17 @@ GIT_EXTERN(int) git_hashsig_create_fromfile(
62
85
 
63
86
  /**
64
87
  * Release memory for a content similarity signature
88
+ *
89
+ * @param sig The similarity signature to free.
65
90
  */
66
91
  GIT_EXTERN(void) git_hashsig_free(git_hashsig *sig);
67
92
 
68
93
  /**
69
- * Measure similarity between two files
94
+ * Measure similarity score between two similarity signatures
70
95
  *
71
- * @return <0 for error, [0 to 100] as similarity score
96
+ * @param a The first similarity signature to compare.
97
+ * @param b The second similarity signature to compare.
98
+ * @return [0 to 100] on success as the similarity score, or error code.
72
99
  */
73
100
  GIT_EXTERN(int) git_hashsig_compare(
74
101
  const git_hashsig *a,