rugged 0.23.0 → 0.23.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rugged/rugged_remote.c +1 -8
  3. data/ext/rugged/rugged_submodule_collection.c +3 -3
  4. data/lib/rugged/version.rb +1 -1
  5. data/vendor/libgit2/CMakeLists.txt +3 -1
  6. data/vendor/libgit2/include/git2/diff.h +19 -0
  7. data/vendor/libgit2/include/git2/errors.h +1 -12
  8. data/vendor/libgit2/include/git2/remote.h +9 -1
  9. data/vendor/libgit2/include/git2/repository.h +1 -1
  10. data/vendor/libgit2/include/git2/sys/config.h +1 -1
  11. data/vendor/libgit2/include/git2/sys/diff.h +4 -4
  12. data/vendor/libgit2/include/git2/sys/filter.h +4 -1
  13. data/vendor/libgit2/include/git2/sys/odb_backend.h +1 -1
  14. data/vendor/libgit2/include/git2/sys/refdb_backend.h +4 -3
  15. data/vendor/libgit2/include/git2/transport.h +14 -21
  16. data/vendor/libgit2/src/blame_git.c +10 -15
  17. data/vendor/libgit2/src/blob.c +6 -0
  18. data/vendor/libgit2/src/branch.c +1 -12
  19. data/vendor/libgit2/src/cache.c +4 -4
  20. data/vendor/libgit2/src/checkout.c +2 -2
  21. data/vendor/libgit2/src/clone.c +2 -2
  22. data/vendor/libgit2/src/common.h +13 -4
  23. data/vendor/libgit2/src/curl_stream.c +7 -7
  24. data/vendor/libgit2/src/describe.c +1 -1
  25. data/vendor/libgit2/src/diff.c +25 -0
  26. data/vendor/libgit2/src/errors.c +75 -40
  27. data/vendor/libgit2/src/filebuf.c +6 -1
  28. data/vendor/libgit2/src/filebuf.h +2 -0
  29. data/vendor/libgit2/src/filter.c +14 -9
  30. data/vendor/libgit2/src/global.c +25 -9
  31. data/vendor/libgit2/src/global.h +1 -0
  32. data/vendor/libgit2/src/index.c +75 -2
  33. data/vendor/libgit2/src/indexer.c +1 -1
  34. data/vendor/libgit2/src/iterator.c +6 -3
  35. data/vendor/libgit2/src/khash.h +1 -1
  36. data/vendor/libgit2/src/merge.c +3 -3
  37. data/vendor/libgit2/src/openssl_stream.c +5 -2
  38. data/vendor/libgit2/src/pack-objects.c +1 -1
  39. data/vendor/libgit2/src/pack.c +2 -2
  40. data/vendor/libgit2/src/path.c +25 -4
  41. data/vendor/libgit2/src/path.h +6 -1
  42. data/vendor/libgit2/src/push.h +3 -1
  43. data/vendor/libgit2/src/rebase.c +2 -2
  44. data/vendor/libgit2/src/refdb_fs.c +7 -0
  45. data/vendor/libgit2/src/remote.c +18 -9
  46. data/vendor/libgit2/src/revwalk.c +1 -1
  47. data/vendor/libgit2/src/stash.c +1 -1
  48. data/vendor/libgit2/src/stransport_stream.c +1 -1
  49. data/vendor/libgit2/src/submodule.c +12 -1
  50. data/vendor/libgit2/src/sysdir.c +22 -8
  51. data/vendor/libgit2/src/thread-utils.c +2 -0
  52. data/vendor/libgit2/src/transports/git.c +2 -0
  53. data/vendor/libgit2/src/transports/http.c +2 -2
  54. data/vendor/libgit2/src/transports/smart_pkt.c +1 -1
  55. data/vendor/libgit2/src/transports/ssh.c +4 -2
  56. data/vendor/libgit2/src/transports/winhttp.c +1 -1
  57. data/vendor/libgit2/src/util.c +48 -0
  58. data/vendor/libgit2/src/util.h +13 -5
  59. data/vendor/libgit2/src/win32/posix_w32.c +2 -0
  60. data/vendor/libgit2/src/win32/{buffer.c → w32_buffer.c} +1 -2
  61. data/vendor/libgit2/src/win32/{buffer.h → w32_buffer.h} +0 -0
  62. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +343 -0
  63. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +93 -0
  64. data/vendor/libgit2/src/win32/w32_stack.c +192 -0
  65. data/vendor/libgit2/src/win32/w32_stack.h +138 -0
  66. data/vendor/libgit2/src/xdiff/xdiff.h +10 -6
  67. data/vendor/libgit2/src/xdiff/xdiffi.c +46 -4
  68. data/vendor/libgit2/src/xdiff/xdiffi.h +1 -0
  69. data/vendor/libgit2/src/xdiff/xemit.c +43 -6
  70. data/vendor/libgit2/src/xdiff/xemit.h +1 -1
  71. data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
  72. data/vendor/libgit2/src/xdiff/xmerge.c +2 -2
  73. data/vendor/libgit2/src/xdiff/xpatience.c +1 -1
  74. data/vendor/libgit2/src/xdiff/xprepare.c +10 -11
  75. data/vendor/libgit2/src/xdiff/xutils.c +13 -29
  76. data/vendor/libgit2/src/xdiff/xutils.h +1 -0
  77. metadata +84 -80
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc5c92158c3f0efe09b400923043fea4b06a616e
4
- data.tar.gz: b77ee9c931d0872300d02da8dd203407d38f8657
3
+ metadata.gz: 908d5cc69a9c2694268229e0c32f174f2e849260
4
+ data.tar.gz: 01f60ed642064d77e78676fb93e7876b5a5c7279
5
5
  SHA512:
6
- metadata.gz: b907420c4a42b97b6175701a373d872b5218a11f59b0e7d8f992f418be4ff9164ed8449727d91628ba1fb1b3a5972a2d33ff3b2162b245232526bb318efca94f
7
- data.tar.gz: 041e9cef3a07e628b6078baeaba421b3965826a6e0c3f2bbf805178eda4590f0172574f012ce9a97a5cb6f456123e2161706c72d38afff05a341197711330bb2
6
+ metadata.gz: 5a3e08df00ea4527b864df64b7490ae0f88182a158ed11128c30691891a90364ce688bed4e3d4b3dbaf94fe918051ea8fb2562cd635afebf7af06f0d99b6a273
7
+ data.tar.gz: d93f2bd237d2e798d03c9096b3989408d8d30b460a35970ce667ebf57b5312edae0726a08a6815f7e9a8dec0f95895ccedbe742d2f519fb97a871bdb74bd9b7d
@@ -514,7 +514,6 @@ static VALUE rb_git_remote_check_connection(int argc, VALUE *argv, VALUE self)
514
514
  static VALUE rb_git_remote_fetch(int argc, VALUE *argv, VALUE self)
515
515
  {
516
516
  git_remote *remote;
517
- git_repository *repo;
518
517
  git_strarray refspecs;
519
518
  git_fetch_options opts = GIT_FETCH_OPTIONS_INIT;
520
519
  const git_transfer_progress *stats;
@@ -523,15 +522,13 @@ static VALUE rb_git_remote_fetch(int argc, VALUE *argv, VALUE self)
523
522
  char *log_message = NULL;
524
523
  int error;
525
524
 
526
- VALUE rb_options, rb_refspecs, rb_result = Qnil, rb_repo = rugged_owner(self);
525
+ VALUE rb_options, rb_refspecs, rb_result = Qnil;
527
526
 
528
527
  rb_scan_args(argc, argv, "01:", &rb_refspecs, &rb_options);
529
528
 
530
529
  rugged_rb_ary_to_strarray(rb_refspecs, &refspecs);
531
530
 
532
531
  Data_Get_Struct(self, git_remote, remote);
533
- rugged_check_repo(rb_repo);
534
- Data_Get_Struct(rb_repo, git_repository, repo);
535
532
 
536
533
  rugged_remote_init_callbacks_and_payload_from_options(rb_options, &opts.callbacks, &payload);
537
534
 
@@ -594,9 +591,7 @@ static VALUE rb_git_remote_fetch(int argc, VALUE *argv, VALUE self)
594
591
  static VALUE rb_git_remote_push(int argc, VALUE *argv, VALUE self)
595
592
  {
596
593
  VALUE rb_refspecs, rb_options;
597
- VALUE rb_repo = rugged_owner(self);
598
594
 
599
- git_repository *repo;
600
595
  git_remote *remote;
601
596
  git_strarray refspecs;
602
597
  git_push_options opts = GIT_PUSH_OPTIONS_INIT;
@@ -609,8 +604,6 @@ static VALUE rb_git_remote_push(int argc, VALUE *argv, VALUE self)
609
604
 
610
605
  rugged_rb_ary_to_strarray(rb_refspecs, &refspecs);
611
606
 
612
- rugged_check_repo(rb_repo);
613
- Data_Get_Struct(rb_repo, git_repository, repo);
614
607
  Data_Get_Struct(self, git_remote, remote);
615
608
 
616
609
  rugged_remote_init_callbacks_and_payload_from_options(rb_options, &opts.callbacks, &payload);
@@ -291,10 +291,10 @@ static git_submodule_update_t rb_git_subm_update_rule_toC(VALUE rb_update_rule)
291
291
  static VALUE rb_git_submodule_update(VALUE self, VALUE rb_name_or_submodule, VALUE rb_settings)
292
292
  {
293
293
  git_repository *repo;
294
- git_submodule_ignore_t ignore_rule;
295
- git_submodule_update_t update_rule;
294
+ git_submodule_ignore_t ignore_rule = GIT_SUBMODULE_IGNORE_UNSPECIFIED;
295
+ git_submodule_update_t update_rule = GIT_SUBMODULE_UPDATE_DEFAULT;
296
296
  const char *submodule_name;
297
- int fetch_recurse_submodules;
297
+ int fetch_recurse_submodules = 0;
298
298
  VALUE rb_repo = rugged_owner(self);
299
299
  VALUE rb_url, rb_fetch_recurse_submodules, rb_ignore_rule, rb_update_rule;
300
300
 
@@ -1,3 +1,3 @@
1
1
  module Rugged
2
- Version = VERSION = '0.23.0'
2
+ Version = VERSION = '0.23.1'
3
3
  end
@@ -12,7 +12,7 @@
12
12
  # > cmake --build . --target install
13
13
 
14
14
  PROJECT(libgit2 C)
15
- CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
15
+ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
16
16
  CMAKE_POLICY(SET CMP0015 NEW)
17
17
 
18
18
  # Add find modules to the path
@@ -336,6 +336,7 @@ IF (MSVC)
336
336
 
337
337
  IF (MSVC_CRTDBG)
338
338
  SET(CRT_FLAG_DEBUG "${CRT_FLAG_DEBUG} /DGIT_MSVC_CRTDBG")
339
+ SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}" "Dbghelp.lib")
339
340
  ENDIF()
340
341
 
341
342
  # /Zi - Create debugging information
@@ -412,6 +413,7 @@ ELSE ()
412
413
  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
413
414
  ENDIF ()
414
415
 
416
+ ADD_C_FLAG_IF_SUPPORTED(-Wdocumentation)
415
417
  ADD_C_FLAG_IF_SUPPORTED(-Wno-missing-field-initializers)
416
418
  ADD_C_FLAG_IF_SUPPORTED(-Wstrict-aliasing=2)
417
419
  ADD_C_FLAG_IF_SUPPORTED(-Wstrict-prototypes)
@@ -835,6 +835,25 @@ GIT_EXTERN(int) git_diff_tree_to_workdir_with_index(
835
835
  git_tree *old_tree,
836
836
  const git_diff_options *opts); /**< can be NULL for defaults */
837
837
 
838
+ /**
839
+ * Create a diff with the difference between two index objects.
840
+ *
841
+ * The first index will be used for the "old_file" side of the delta and the
842
+ * second index will be used for the "new_file" side of the delta.
843
+ *
844
+ * @param diff Output pointer to a git_diff pointer to be allocated.
845
+ * @param repo The repository containing the indexes.
846
+ * @param old_index A git_index object to diff from.
847
+ * @param new_index A git_index object to diff to.
848
+ * @param opts Structure with options to influence diff or NULL for defaults.
849
+ */
850
+ GIT_EXTERN(int) git_diff_index_to_index(
851
+ git_diff **diff,
852
+ git_repository *repo,
853
+ git_index *old_index,
854
+ git_index *new_index,
855
+ const git_diff_options *opts); /**< can be NULL for defaults */
856
+
838
857
  /**
839
858
  * Merge one diff into another.
840
859
  *
@@ -48,6 +48,7 @@ typedef enum {
48
48
  GIT_EEOF = -20, /**< Unexpected EOF */
49
49
  GIT_EINVALID = -21, /**< Invalid operation or input */
50
50
  GIT_EUNCOMMITTED = -22, /**< Uncommitted changes in index prevented operation */
51
+ GIT_EDIRECTORY = -23, /**< The operation is not valid for a directory */
51
52
 
52
53
  GIT_PASSTHROUGH = -30, /**< Internal only */
53
54
  GIT_ITEROVER = -31, /**< Signals end of iteration with iterator */
@@ -112,18 +113,6 @@ GIT_EXTERN(const git_error *) giterr_last(void);
112
113
  */
113
114
  GIT_EXTERN(void) giterr_clear(void);
114
115
 
115
- /**
116
- * Get the last error data and clear it.
117
- *
118
- * This copies the last error into the given `git_error` struct
119
- * and returns 0 if the copy was successful, leaving the error
120
- * cleared as if `giterr_clear` had been called.
121
- *
122
- * If there was no existing error in the library, -1 will be returned
123
- * and the contents of `cpy` will be left unmodified.
124
- */
125
- GIT_EXTERN(int) giterr_detach(git_error *cpy);
126
-
127
116
  /**
128
117
  * Set the error message string for this thread.
129
118
  *
@@ -511,6 +511,14 @@ typedef enum {
511
511
  GIT_REMOTE_DOWNLOAD_TAGS_ALL,
512
512
  } git_remote_autotag_option_t;
513
513
 
514
+ /**
515
+ * Fetch options structure.
516
+ *
517
+ * Zero out for defaults. Initialize with `GIT_FETCH_OPTIONS_INIT` macro to
518
+ * correctly set the `version` field. E.g.
519
+ *
520
+ * git_fetch_options opts = GIT_FETCH_OPTIONS_INIT;
521
+ */
514
522
  typedef struct {
515
523
  int version;
516
524
 
@@ -739,7 +747,7 @@ GIT_EXTERN(int) git_remote_prune_refs(const git_remote *remote);
739
747
  * stored here for further processing by the caller. Always free this
740
748
  * strarray on successful return.
741
749
  * @param repo the repository in which to rename
742
- * @param name the current name of the reamote
750
+ * @param name the current name of the remote
743
751
  * @param new_name the new name the remote should bear
744
752
  * @return 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code
745
753
  */
@@ -745,7 +745,7 @@ GIT_EXTERN(int) git_repository_ident(const char **name, const char **email, cons
745
745
  *
746
746
  * @param repo the repository to configure
747
747
  * @param name the name to use for the reflog entries
748
- * @param name the email to use for the reflog entries
748
+ * @param email the email to use for the reflog entries
749
749
  */
750
750
  GIT_EXTERN(int) git_repository_set_ident(git_repository *repo, const char *name, const char *email);
751
751
 
@@ -76,7 +76,7 @@ struct git_config_backend {
76
76
  * Initializes a `git_config_backend` with default values. Equivalent to
77
77
  * creating an instance with GIT_CONFIG_BACKEND_INIT.
78
78
  *
79
- * @param opts the `git_config_backend` struct to initialize.
79
+ * @param backend the `git_config_backend` struct to initialize.
80
80
  * @param version Version of struct; pass `GIT_CONFIG_BACKEND_VERSION`
81
81
  * @return Zero on success; -1 on failure.
82
82
  */
@@ -38,7 +38,7 @@ GIT_EXTERN(int) git_diff_print_callback__to_buf(
38
38
  const git_diff_delta *delta,
39
39
  const git_diff_hunk *hunk,
40
40
  const git_diff_line *line,
41
- void *payload); /*< payload must be a `git_buf *` */
41
+ void *payload); /**< payload must be a `git_buf *` */
42
42
 
43
43
  /**
44
44
  * Diff print callback that writes to stdio FILE handle.
@@ -58,7 +58,7 @@ GIT_EXTERN(int) git_diff_print_callback__to_file_handle(
58
58
  const git_diff_delta *delta,
59
59
  const git_diff_hunk *hunk,
60
60
  const git_diff_line *line,
61
- void *payload); /*< payload must be a `FILE *` */
61
+ void *payload); /**< payload must be a `FILE *` */
62
62
 
63
63
 
64
64
  /**
@@ -66,8 +66,8 @@ GIT_EXTERN(int) git_diff_print_callback__to_file_handle(
66
66
  */
67
67
  typedef struct {
68
68
  unsigned int version;
69
- size_t stat_calls; /*< Number of stat() calls performed */
70
- size_t oid_calculations; /*< Number of ID calculations */
69
+ size_t stat_calls; /**< Number of stat() calls performed */
70
+ size_t oid_calculations; /**< Number of ID calculations */
71
71
  } git_diff_perfdata;
72
72
 
73
73
  #define GIT_DIFF_PERFDATA_VERSION 1
@@ -240,7 +240,10 @@ typedef void (*git_filter_cleanup_fn)(
240
240
  * for this filter (e.g. "eol crlf text"). If the attribute name is bare,
241
241
  * it will be simply loaded and passed to the `check` callback. If it has
242
242
  * a value (i.e. "name=value"), the attribute must match that value for
243
- * the filter to be applied.
243
+ * the filter to be applied. The value may be a wildcard (eg, "name=*"),
244
+ * in which case the filter will be invoked for any value for the given
245
+ * attribute name. See the attribute parameter of the `check` callback
246
+ * for the attribute value that was specified.
244
247
  *
245
248
  * The `initialize`, `shutdown`, `check`, `apply`, and `cleanup` callbacks
246
249
  * are all documented above with the respective function pointer typedefs.
@@ -93,7 +93,7 @@ struct git_odb_backend {
93
93
  * Initializes a `git_odb_backend` with default values. Equivalent to
94
94
  * creating an instance with GIT_ODB_BACKEND_INIT.
95
95
  *
96
- * @param opts the `git_odb_backend` struct to initialize.
96
+ * @param backend the `git_odb_backend` struct to initialize.
97
97
  * @param version Version the struct; pass `GIT_ODB_BACKEND_VERSION`
98
98
  * @return Zero on success; -1 on failure.
99
99
  */
@@ -103,8 +103,9 @@ struct git_refdb_backend {
103
103
  const git_signature *who, const char *message);
104
104
 
105
105
  /**
106
- * Deletes the given reference from the refdb. A refdb implementation
107
- * must provide this function.
106
+ * Deletes the given reference (and if necessary its reflog)
107
+ * from the refdb. A refdb implementation must provide this
108
+ * function.
108
109
  */
109
110
  int (*del)(git_refdb_backend *backend, const char *ref_name, const git_oid *old_id, const char *old_target);
110
111
 
@@ -175,7 +176,7 @@ struct git_refdb_backend {
175
176
  * Initializes a `git_refdb_backend` with default values. Equivalent to
176
177
  * creating an instance with GIT_REFDB_BACKEND_INIT.
177
178
  *
178
- * @param opts the `git_refdb_backend` struct to initialize
179
+ * @param backend the `git_refdb_backend` struct to initialize
179
180
  * @param version Version of struct; pass `GIT_REFDB_BACKEND_VERSION`
180
181
  * @return Zero on success; -1 on failure.
181
182
  */
@@ -37,39 +37,32 @@ typedef enum {
37
37
  * Hostkey information taken from libssh2
38
38
  */
39
39
  typedef struct {
40
+ git_cert parent;
41
+
40
42
  /**
41
- * Type of certificate. Here to share the header with
42
- * `git_cert`.
43
+ * A hostkey type from libssh2, either
44
+ * `GIT_CERT_SSH_MD5` or `GIT_CERT_SSH_SHA1`
43
45
  */
44
- git_cert_t cert_type;
45
- /**
46
- * A hostkey type from libssh2, either
47
- * `GIT_CERT_SSH_MD5` or `GIT_CERT_SSH_SHA1`
48
- */
49
46
  git_cert_ssh_t type;
50
47
 
51
- /**
52
- * Hostkey hash. If type has `GIT_CERT_SSH_MD5` set, this will
53
- * have the MD5 hash of the hostkey.
54
- */
48
+ /**
49
+ * Hostkey hash. If type has `GIT_CERT_SSH_MD5` set, this will
50
+ * have the MD5 hash of the hostkey.
51
+ */
55
52
  unsigned char hash_md5[16];
56
53
 
57
- /**
58
- * Hostkey hash. If type has `GIT_CERT_SSH_SHA1` set, this will
59
- * have the SHA-1 hash of the hostkey.
60
- */
61
- unsigned char hash_sha1[20];
54
+ /**
55
+ * Hostkey hash. If type has `GIT_CERT_SSH_SHA1` set, this will
56
+ * have the SHA-1 hash of the hostkey.
57
+ */
58
+ unsigned char hash_sha1[20];
62
59
  } git_cert_hostkey;
63
60
 
64
61
  /**
65
62
  * X.509 certificate information
66
63
  */
67
64
  typedef struct {
68
- /**
69
- * Type of certificate. Here to share the header with
70
- * `git_cert`.
71
- */
72
- git_cert_t cert_type;
65
+ git_cert parent;
73
66
  /**
74
67
  * Pointer to the X.509 certificate data
75
68
  */
@@ -304,21 +304,16 @@ static void blame_chunk(
304
304
  }
305
305
 
306
306
  static int my_emit(
307
- xdfenv_t *xe,
308
- xdchange_t *xscr,
309
- xdemitcb_t *ecb,
310
- xdemitconf_t const *xecfg)
307
+ long start_a, long count_a,
308
+ long start_b, long count_b,
309
+ void *cb_data)
311
310
  {
312
- xdchange_t *xch = xscr;
313
- GIT_UNUSED(xe);
314
- GIT_UNUSED(xecfg);
315
- while (xch) {
316
- blame_chunk_cb_data *d = ecb->priv;
317
- blame_chunk(d->blame, d->tlno, d->plno, xch->i2, d->target, d->parent);
318
- d->plno = xch->i1 + xch->chg1;
319
- d->tlno = xch->i2 + xch->chg2;
320
- xch = xch->next;
321
- }
311
+ blame_chunk_cb_data *d = (blame_chunk_cb_data *)cb_data;
312
+
313
+ blame_chunk(d->blame, d->tlno, d->plno, start_b, d->target, d->parent);
314
+ d->plno = start_a + count_a;
315
+ d->tlno = start_b + count_b;
316
+
322
317
  return 0;
323
318
  }
324
319
 
@@ -352,7 +347,7 @@ static int diff_hunks(mmfile_t file_a, mmfile_t file_b, void *cb_data)
352
347
  xdemitconf_t xecfg = {0};
353
348
  xdemitcb_t ecb = {0};
354
349
 
355
- xecfg.emit_func = (void(*)(void))my_emit;
350
+ xecfg.hunk_func = my_emit;
356
351
  ecb.priv = cb_data;
357
352
 
358
353
  trim_common_tail(&file_a, &file_b, 0);
@@ -185,6 +185,12 @@ int git_blob__create_from_paths(
185
185
  (error = git_repository_odb(&odb, repo)) < 0)
186
186
  goto done;
187
187
 
188
+ if (S_ISDIR(st.st_mode)) {
189
+ giterr_set(GITERR_ODB, "cannot create blob from '%s'; it is a directory", content_path);
190
+ error = GIT_EDIRECTORY;
191
+ goto done;
192
+ }
193
+
188
194
  if (out_st)
189
195
  memcpy(out_st, &st, sizeof(st));
190
196
 
@@ -155,18 +155,7 @@ int git_branch_delete(git_reference *branch)
155
155
  git_reference_owner(branch), git_buf_cstr(&config_section), NULL) < 0)
156
156
  goto on_error;
157
157
 
158
- if (git_reference_delete(branch) < 0)
159
- goto on_error;
160
-
161
- if ((error = git_reflog_delete(git_reference_owner(branch), git_reference_name(branch))) < 0) {
162
- if (error == GIT_ENOTFOUND) {
163
- giterr_clear();
164
- error = 0;
165
- }
166
- goto on_error;
167
- }
168
-
169
- error = 0;
158
+ error = git_reference_delete(branch);
170
159
 
171
160
  on_error:
172
161
  git_buf_free(&config_section);
@@ -50,16 +50,16 @@ void git_cache_dump_stats(git_cache *cache)
50
50
  if (kh_size(cache->map) == 0)
51
51
  return;
52
52
 
53
- printf("Cache %p: %d items cached, %d bytes\n",
54
- cache, kh_size(cache->map), (int)cache->used_memory);
53
+ printf("Cache %p: %d items cached, %"PRIdZ" bytes\n",
54
+ cache, kh_size(cache->map), cache->used_memory);
55
55
 
56
56
  kh_foreach_value(cache->map, object, {
57
57
  char oid_str[9];
58
- printf(" %s%c %s (%d)\n",
58
+ printf(" %s%c %s (%"PRIuZ")\n",
59
59
  git_object_type2string(object->type),
60
60
  object->flags == GIT_CACHE_STORE_PARSED ? '*' : ' ',
61
61
  git_oid_tostr(oid_str, sizeof(oid_str), &object->oid),
62
- (int)object->size
62
+ object->size
63
63
  );
64
64
  });
65
65
  }
@@ -1299,8 +1299,8 @@ static int checkout_get_actions(
1299
1299
  if (counts[CHECKOUT_ACTION__CONFLICT] > 0 &&
1300
1300
  (data->strategy & GIT_CHECKOUT_ALLOW_CONFLICTS) == 0)
1301
1301
  {
1302
- giterr_set(GITERR_CHECKOUT, "%d %s checkout",
1303
- (int)counts[CHECKOUT_ACTION__CONFLICT],
1302
+ giterr_set(GITERR_CHECKOUT, "%"PRIuZ" %s checkout",
1303
+ counts[CHECKOUT_ACTION__CONFLICT],
1304
1304
  counts[CHECKOUT_ACTION__CONFLICT] == 1 ?
1305
1305
  "conflict prevents" : "conflicts prevent");
1306
1306
  error = GIT_ECONFLICT;
@@ -440,14 +440,14 @@ int git_clone(
440
440
 
441
441
  if (error != 0) {
442
442
  git_error_state last_error = {0};
443
- giterr_capture(&last_error, error);
443
+ giterr_state_capture(&last_error, error);
444
444
 
445
445
  git_repository_free(repo);
446
446
  repo = NULL;
447
447
 
448
448
  (void)git_futils_rmdir_r(local_path, NULL, rmdir_flags);
449
449
 
450
- giterr_restore(&last_error);
450
+ giterr_state_restore(&last_error);
451
451
  }
452
452
 
453
453
  *out = repo;