rugged 0.27.7 → 0.27.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rugged/version.rb +1 -1
  3. data/vendor/libgit2/CMakeLists.txt +6 -2
  4. data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in +29 -0
  5. data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake +96 -0
  6. data/vendor/libgit2/cmake/Modules/FindIconv.cmake +11 -6
  7. data/vendor/libgit2/deps/http-parser/CMakeLists.txt +0 -2
  8. data/vendor/libgit2/include/git2.h +0 -1
  9. data/vendor/libgit2/include/git2/attr.h +7 -18
  10. data/vendor/libgit2/include/git2/blame.h +22 -39
  11. data/vendor/libgit2/include/git2/blob.h +1 -1
  12. data/vendor/libgit2/include/git2/branch.h +1 -1
  13. data/vendor/libgit2/include/git2/buffer.h +2 -14
  14. data/vendor/libgit2/include/git2/checkout.h +12 -13
  15. data/vendor/libgit2/include/git2/cherrypick.h +4 -6
  16. data/vendor/libgit2/include/git2/clone.h +6 -8
  17. data/vendor/libgit2/include/git2/commit.h +0 -28
  18. data/vendor/libgit2/include/git2/common.h +0 -27
  19. data/vendor/libgit2/include/git2/config.h +0 -1
  20. data/vendor/libgit2/include/git2/describe.h +7 -30
  21. data/vendor/libgit2/include/git2/diff.h +22 -32
  22. data/vendor/libgit2/include/git2/errors.h +0 -1
  23. data/vendor/libgit2/include/git2/ignore.h +2 -2
  24. data/vendor/libgit2/include/git2/merge.h +8 -10
  25. data/vendor/libgit2/include/git2/proxy.h +5 -9
  26. data/vendor/libgit2/include/git2/rebase.h +4 -7
  27. data/vendor/libgit2/include/git2/refs.h +1 -1
  28. data/vendor/libgit2/include/git2/refspec.h +0 -17
  29. data/vendor/libgit2/include/git2/remote.h +10 -12
  30. data/vendor/libgit2/include/git2/repository.h +5 -7
  31. data/vendor/libgit2/include/git2/revert.h +3 -5
  32. data/vendor/libgit2/include/git2/stash.h +8 -11
  33. data/vendor/libgit2/include/git2/status.h +3 -7
  34. data/vendor/libgit2/include/git2/submodule.h +7 -8
  35. data/vendor/libgit2/include/git2/sys/index.h +0 -3
  36. data/vendor/libgit2/include/git2/sys/mempack.h +35 -35
  37. data/vendor/libgit2/include/git2/sys/merge.h +1 -6
  38. data/vendor/libgit2/include/git2/transaction.h +0 -1
  39. data/vendor/libgit2/include/git2/types.h +5 -8
  40. data/vendor/libgit2/include/git2/version.h +2 -2
  41. data/vendor/libgit2/include/git2/worktree.h +11 -46
  42. data/vendor/libgit2/src/CMakeLists.txt +28 -91
  43. data/vendor/libgit2/src/annotated_commit.c +4 -4
  44. data/vendor/libgit2/src/apply.c +6 -5
  45. data/vendor/libgit2/src/attr.c +4 -4
  46. data/vendor/libgit2/src/attr_file.c +5 -5
  47. data/vendor/libgit2/src/attrcache.c +2 -2
  48. data/vendor/libgit2/src/blame.c +4 -11
  49. data/vendor/libgit2/src/blame.h +0 -1
  50. data/vendor/libgit2/src/blame_git.c +5 -8
  51. data/vendor/libgit2/src/blob.c +5 -5
  52. data/vendor/libgit2/src/branch.c +20 -20
  53. data/vendor/libgit2/src/buffer.c +4 -9
  54. data/vendor/libgit2/src/buffer.h +1 -1
  55. data/vendor/libgit2/src/checkout.c +24 -33
  56. data/vendor/libgit2/src/cherrypick.c +3 -3
  57. data/vendor/libgit2/src/clone.c +13 -13
  58. data/vendor/libgit2/src/commit.c +5 -18
  59. data/vendor/libgit2/src/commit_list.c +9 -3
  60. data/vendor/libgit2/src/common.h +1 -3
  61. data/vendor/libgit2/src/config.c +15 -6
  62. data/vendor/libgit2/src/config_file.c +249 -193
  63. data/vendor/libgit2/src/config_parse.c +66 -89
  64. data/vendor/libgit2/src/config_parse.h +2 -2
  65. data/vendor/libgit2/src/crlf.c +3 -9
  66. data/vendor/libgit2/src/diff.c +2 -2
  67. data/vendor/libgit2/src/diff_driver.c +3 -3
  68. data/vendor/libgit2/src/diff_file.c +3 -3
  69. data/vendor/libgit2/src/diff_generate.c +3 -4
  70. data/vendor/libgit2/src/diff_print.c +8 -8
  71. data/vendor/libgit2/src/diff_tform.c +4 -2
  72. data/vendor/libgit2/src/diff_xdiff.c +0 -12
  73. data/vendor/libgit2/src/features.h.in +0 -2
  74. data/vendor/libgit2/src/fetch.c +2 -2
  75. data/vendor/libgit2/src/fetchhead.c +5 -5
  76. data/vendor/libgit2/src/filebuf.c +4 -4
  77. data/vendor/libgit2/src/fileops.c +10 -10
  78. data/vendor/libgit2/src/filter.c +9 -3
  79. data/vendor/libgit2/src/global.c +12 -17
  80. data/vendor/libgit2/src/hash.h +0 -2
  81. data/vendor/libgit2/src/ignore.c +5 -5
  82. data/vendor/libgit2/src/index.c +40 -80
  83. data/vendor/libgit2/src/index.h +0 -10
  84. data/vendor/libgit2/src/indexer.c +9 -9
  85. data/vendor/libgit2/src/iterator.c +8 -8
  86. data/vendor/libgit2/src/khash.h +1 -3
  87. data/vendor/libgit2/src/merge.c +7 -7
  88. data/vendor/libgit2/src/netops.c +5 -5
  89. data/vendor/libgit2/src/notes.c +2 -2
  90. data/vendor/libgit2/src/odb.c +9 -9
  91. data/vendor/libgit2/src/odb_loose.c +22 -18
  92. data/vendor/libgit2/src/odb_pack.c +3 -3
  93. data/vendor/libgit2/src/pack-objects.c +3 -3
  94. data/vendor/libgit2/src/pack.c +5 -5
  95. data/vendor/libgit2/src/pack.h +1 -1
  96. data/vendor/libgit2/src/parse.c +7 -4
  97. data/vendor/libgit2/src/patch.c +1 -1
  98. data/vendor/libgit2/src/patch_generate.c +2 -2
  99. data/vendor/libgit2/src/patch_parse.c +4 -24
  100. data/vendor/libgit2/src/path.c +140 -39
  101. data/vendor/libgit2/src/path.h +84 -2
  102. data/vendor/libgit2/src/pathspec.c +1 -1
  103. data/vendor/libgit2/src/push.c +2 -2
  104. data/vendor/libgit2/src/rebase.c +23 -20
  105. data/vendor/libgit2/src/refdb_fs.c +34 -65
  106. data/vendor/libgit2/src/refs.c +16 -13
  107. data/vendor/libgit2/src/refspec.c +5 -30
  108. data/vendor/libgit2/src/refspec.h +1 -1
  109. data/vendor/libgit2/src/remote.c +43 -43
  110. data/vendor/libgit2/src/repository.c +56 -56
  111. data/vendor/libgit2/src/reset.c +1 -1
  112. data/vendor/libgit2/src/revert.c +3 -3
  113. data/vendor/libgit2/src/revparse.c +7 -6
  114. data/vendor/libgit2/src/revwalk.c +20 -48
  115. data/vendor/libgit2/src/revwalk.h +1 -2
  116. data/vendor/libgit2/src/settings.c +1 -25
  117. data/vendor/libgit2/src/signature.c +4 -2
  118. data/vendor/libgit2/src/stash.c +34 -80
  119. data/vendor/libgit2/src/status.c +1 -1
  120. data/vendor/libgit2/src/streams/curl.c +1 -1
  121. data/vendor/libgit2/src/streams/openssl.c +34 -132
  122. data/vendor/libgit2/src/streams/openssl.h +107 -0
  123. data/vendor/libgit2/src/streams/tls.c +0 -3
  124. data/vendor/libgit2/src/submodule.c +83 -118
  125. data/vendor/libgit2/src/sysdir.c +4 -4
  126. data/vendor/libgit2/src/tag.c +12 -12
  127. data/vendor/libgit2/src/trace.h +1 -1
  128. data/vendor/libgit2/src/trailer.c +6 -6
  129. data/vendor/libgit2/src/transport.c +2 -2
  130. data/vendor/libgit2/src/transports/auth.c +1 -1
  131. data/vendor/libgit2/src/transports/auth_negotiate.c +2 -2
  132. data/vendor/libgit2/src/transports/git.c +1 -1
  133. data/vendor/libgit2/src/transports/http.c +15 -12
  134. data/vendor/libgit2/src/transports/local.c +7 -7
  135. data/vendor/libgit2/src/transports/smart.c +15 -20
  136. data/vendor/libgit2/src/transports/smart.h +5 -5
  137. data/vendor/libgit2/src/transports/smart_pkt.c +131 -123
  138. data/vendor/libgit2/src/transports/smart_protocol.c +38 -48
  139. data/vendor/libgit2/src/transports/ssh.c +1 -1
  140. data/vendor/libgit2/src/transports/winhttp.c +26 -21
  141. data/vendor/libgit2/src/tree-cache.c +2 -2
  142. data/vendor/libgit2/src/tree.c +69 -23
  143. data/vendor/libgit2/src/tree.h +12 -0
  144. data/vendor/libgit2/src/util.c +99 -52
  145. data/vendor/libgit2/src/util.h +138 -14
  146. data/vendor/libgit2/src/vector.c +13 -8
  147. data/vendor/libgit2/src/win32/findfile.c +2 -2
  148. data/vendor/libgit2/src/win32/posix_w32.c +1 -1
  149. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +0 -94
  150. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +75 -28
  151. data/vendor/libgit2/src/worktree.c +44 -65
  152. data/vendor/libgit2/src/worktree.h +0 -2
  153. data/vendor/libgit2/src/xdiff/xdiffi.c +1 -3
  154. metadata +5 -17
  155. data/vendor/libgit2/cmake/Modules/FindmbedTLS.cmake +0 -93
  156. data/vendor/libgit2/include/git2/mailmap.h +0 -115
  157. data/vendor/libgit2/include/git2/sys/alloc.h +0 -101
  158. data/vendor/libgit2/include/git2/sys/path.h +0 -55
  159. data/vendor/libgit2/src/alloc.c +0 -47
  160. data/vendor/libgit2/src/alloc.h +0 -40
  161. data/vendor/libgit2/src/hash/hash_mbedtls.c +0 -38
  162. data/vendor/libgit2/src/hash/hash_mbedtls.h +0 -20
  163. data/vendor/libgit2/src/mailmap.c +0 -485
  164. data/vendor/libgit2/src/mailmap.h +0 -35
  165. data/vendor/libgit2/src/stdalloc.c +0 -120
  166. data/vendor/libgit2/src/stdalloc.h +0 -17
  167. data/vendor/libgit2/src/streams/mbedtls.c +0 -463
  168. data/vendor/libgit2/src/streams/mbedtls.h +0 -20
@@ -282,7 +282,7 @@ int git_reference__read_head(
282
282
 
283
283
  out:
284
284
  git__free(name);
285
- git_buf_dispose(&reference);
285
+ git_buf_free(&reference);
286
286
 
287
287
  return error;
288
288
  }
@@ -346,8 +346,8 @@ cleanup:
346
346
  if (error == GIT_ENOTFOUND)
347
347
  giterr_set(GITERR_REFERENCE, "no reference found for shorthand '%s'", refname);
348
348
 
349
- git_buf_dispose(&name);
350
- git_buf_dispose(&refnamebuf);
349
+ git_buf_free(&name);
350
+ git_buf_free(&refnamebuf);
351
351
  return error;
352
352
  }
353
353
 
@@ -709,6 +709,8 @@ int git_reference_rename(
709
709
  git_signature *who;
710
710
  int error;
711
711
 
712
+ assert(out && ref);
713
+
712
714
  if ((error = git_reference__log_signature(&who, ref->db->repo)) < 0)
713
715
  return error;
714
716
 
@@ -1076,7 +1078,7 @@ cleanup:
1076
1078
  "the given reference name '%s' is not valid", name);
1077
1079
 
1078
1080
  if (error && normalize)
1079
- git_buf_dispose(buf);
1081
+ git_buf_free(buf);
1080
1082
 
1081
1083
  #ifdef GIT_USE_ICONV
1082
1084
  git_path_iconv_clear(&ic);
@@ -1110,7 +1112,7 @@ int git_reference_normalize_name(
1110
1112
  error = 0;
1111
1113
 
1112
1114
  cleanup:
1113
- git_buf_dispose(&buf);
1115
+ git_buf_free(&buf);
1114
1116
  return error;
1115
1117
  }
1116
1118
 
@@ -1262,7 +1264,7 @@ int git_reference__update_for_commit(
1262
1264
 
1263
1265
  done:
1264
1266
  git_reference_free(ref_new);
1265
- git_buf_dispose(&reflog_msg);
1267
+ git_buf_free(&reflog_msg);
1266
1268
  git_commit_free(commit);
1267
1269
  return error;
1268
1270
  }
@@ -1337,7 +1339,7 @@ int git_reference_is_note(const git_reference *ref)
1337
1339
  return git_reference__is_note(ref->name);
1338
1340
  }
1339
1341
 
1340
- static int peel_error(int error, git_reference *ref, const char* msg)
1342
+ static int peel_error(int error, const git_reference *ref, const char* msg)
1341
1343
  {
1342
1344
  giterr_set(
1343
1345
  GITERR_INVALID,
@@ -1347,10 +1349,11 @@ static int peel_error(int error, git_reference *ref, const char* msg)
1347
1349
 
1348
1350
  int git_reference_peel(
1349
1351
  git_object **peeled,
1350
- git_reference *ref,
1352
+ const git_reference *ref,
1351
1353
  git_otype target_type)
1352
1354
  {
1353
- git_reference *resolved = NULL;
1355
+ const git_reference *resolved = NULL;
1356
+ git_reference *allocated = NULL;
1354
1357
  git_object *target = NULL;
1355
1358
  int error;
1356
1359
 
@@ -1359,8 +1362,10 @@ int git_reference_peel(
1359
1362
  if (ref->type == GIT_REF_OID) {
1360
1363
  resolved = ref;
1361
1364
  } else {
1362
- if ((error = git_reference_resolve(&resolved, ref)) < 0)
1365
+ if ((error = git_reference_resolve(&allocated, ref)) < 0)
1363
1366
  return peel_error(error, ref, "Cannot resolve reference");
1367
+
1368
+ resolved = allocated;
1364
1369
  }
1365
1370
 
1366
1371
  /*
@@ -1389,9 +1394,7 @@ int git_reference_peel(
1389
1394
 
1390
1395
  cleanup:
1391
1396
  git_object_free(target);
1392
-
1393
- if (resolved != ref)
1394
- git_reference_free(resolved);
1397
+ git_reference_free(allocated);
1395
1398
 
1396
1399
  return error;
1397
1400
  }
@@ -16,7 +16,7 @@
16
16
 
17
17
  int git_refspec__parse(git_refspec *refspec, const char *input, bool is_fetch)
18
18
  {
19
- /* Ported from https://github.com/git/git/blob/f06d47e7e0d9db709ee204ed13a8a7486149f494/remote.c#L518-636 */
19
+ // Ported from https://github.com/git/git/blob/f06d47e7e0d9db709ee204ed13a8a7486149f494/remote.c#L518-636
20
20
 
21
21
  size_t llen;
22
22
  int is_glob = 0;
@@ -144,11 +144,11 @@ int git_refspec__parse(git_refspec *refspec, const char *input, bool is_fetch)
144
144
  giterr_set(
145
145
  GITERR_INVALID,
146
146
  "'%s' is not a valid refspec.", input);
147
- git_refspec__dispose(refspec);
147
+ git_refspec__free(refspec);
148
148
  return -1;
149
149
  }
150
150
 
151
- void git_refspec__dispose(git_refspec *refspec)
151
+ void git_refspec__free(git_refspec *refspec)
152
152
  {
153
153
  if (refspec == NULL)
154
154
  return;
@@ -160,31 +160,6 @@ void git_refspec__dispose(git_refspec *refspec)
160
160
  memset(refspec, 0x0, sizeof(git_refspec));
161
161
  }
162
162
 
163
- int git_refspec_parse(git_refspec **out_refspec, const char *input, int is_fetch)
164
- {
165
- git_refspec *refspec;
166
- assert(out_refspec && input);
167
-
168
- *out_refspec = NULL;
169
-
170
- refspec = git__malloc(sizeof(git_refspec));
171
- GITERR_CHECK_ALLOC(refspec);
172
-
173
- if (git_refspec__parse(refspec, input, !!is_fetch) != 0) {
174
- git__free(refspec);
175
- return -1;
176
- }
177
-
178
- *out_refspec = refspec;
179
- return 0;
180
- }
181
-
182
- void git_refspec_free(git_refspec *refspec)
183
- {
184
- git_refspec__dispose(refspec);
185
- git__free(refspec);
186
- }
187
-
188
163
  const char *git_refspec_src(const git_refspec *refspec)
189
164
  {
190
165
  return refspec == NULL ? NULL : refspec->src;
@@ -277,7 +252,7 @@ int git_refspec_transform(git_buf *out, const git_refspec *spec, const char *nam
277
252
  }
278
253
 
279
254
  if (!spec->pattern)
280
- return git_buf_puts(out, spec->dst ? spec->dst : "");
255
+ return git_buf_puts(out, spec->dst);
281
256
 
282
257
  return refspec_transform(out, spec->src, spec->dst, name);
283
258
  }
@@ -384,7 +359,7 @@ int git_refspec__dwim_one(git_vector *out, git_refspec *spec, git_vector *refs)
384
359
  cur->dst = git_buf_detach(&buf);
385
360
  }
386
361
 
387
- git_buf_dispose(&buf);
362
+ git_buf_free(&buf);
388
363
 
389
364
  if (cur->dst == NULL && spec->dst != NULL) {
390
365
  cur->dst = git__strdup(spec->dst);
@@ -30,7 +30,7 @@ int git_refspec__parse(
30
30
  const char *str,
31
31
  bool is_fetch);
32
32
 
33
- void git_refspec__dispose(git_refspec *refspec);
33
+ void git_refspec__free(git_refspec *refspec);
34
34
 
35
35
  int git_refspec__serialize(git_buf *out, const git_refspec *refspec);
36
36
 
@@ -44,7 +44,7 @@ static int add_refspec_to(git_vector *vector, const char *string, bool is_fetch)
44
44
 
45
45
  spec->push = !is_fetch;
46
46
  if (git_vector_insert(vector, spec) < 0) {
47
- git_refspec__dispose(spec);
47
+ git_refspec__free(spec);
48
48
  git__free(spec);
49
49
  return -1;
50
50
  }
@@ -67,7 +67,7 @@ static int download_tags_value(git_remote *remote, git_config *cfg)
67
67
  return -1;
68
68
 
69
69
  error = git_config__lookup_entry(&ce, cfg, git_buf_cstr(&buf), false);
70
- git_buf_dispose(&buf);
70
+ git_buf_free(&buf);
71
71
 
72
72
  if (!error && ce && ce->value) {
73
73
  if (!strcmp(ce->value, "--no-tags"))
@@ -117,7 +117,7 @@ static int write_add_refspec(git_repository *repo, const char *name, const char
117
117
  return error;
118
118
  }
119
119
 
120
- git_refspec__dispose(&spec);
120
+ git_refspec__free(&spec);
121
121
 
122
122
  if ((error = git_buf_printf(&var, fmt, name)) < 0)
123
123
  return error;
@@ -132,7 +132,7 @@ static int write_add_refspec(git_repository *repo, const char *name, const char
132
132
  }
133
133
 
134
134
  cleanup:
135
- git_buf_dispose(&var);
135
+ git_buf_free(&var);
136
136
  return 0;
137
137
  }
138
138
 
@@ -255,7 +255,7 @@ static int create_internal(git_remote **out, git_repository *repo, const char *n
255
255
  remote->download_tags = GIT_REMOTE_DOWNLOAD_TAGS_AUTO;
256
256
 
257
257
 
258
- git_buf_dispose(&var);
258
+ git_buf_free(&var);
259
259
 
260
260
  *out = remote;
261
261
  error = 0;
@@ -265,8 +265,8 @@ on_error:
265
265
  git_remote_free(remote);
266
266
 
267
267
  git_config_free(config_ro);
268
- git_buf_dispose(&canonical_url);
269
- git_buf_dispose(&var);
268
+ git_buf_free(&canonical_url);
269
+ git_buf_free(&var);
270
270
  return error;
271
271
  }
272
272
 
@@ -302,7 +302,7 @@ int git_remote_create(git_remote **out, git_repository *repo, const char *name,
302
302
  return -1;
303
303
 
304
304
  error = git_remote_create_with_fetchspec(out, repo, name, url, git_buf_cstr(&buf));
305
- git_buf_dispose(&buf);
305
+ git_buf_free(&buf);
306
306
 
307
307
  return error;
308
308
  }
@@ -428,7 +428,7 @@ static int get_optional_config(
428
428
 
429
429
  int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
430
430
  {
431
- git_remote *remote;
431
+ git_remote *remote = NULL;
432
432
  git_buf buf = GIT_BUF_INIT;
433
433
  const char *val;
434
434
  int error = 0;
@@ -510,7 +510,7 @@ int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
510
510
  if ((error = get_optional_config(NULL, config, &buf, refspec_cb, &data)) < 0)
511
511
  goto cleanup;
512
512
 
513
- if (download_tags_value(remote, config) < 0)
513
+ if ((error = download_tags_value(remote, config)) < 0)
514
514
  goto cleanup;
515
515
 
516
516
  if ((error = lookup_remote_prune_config(remote, config, name)) < 0)
@@ -524,7 +524,7 @@ int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
524
524
 
525
525
  cleanup:
526
526
  git_config_free(config);
527
- git_buf_dispose(&buf);
527
+ git_buf_free(&buf);
528
528
 
529
529
  if (error < 0)
530
530
  git_remote_free(remote);
@@ -552,7 +552,7 @@ static int lookup_remote_prune_config(git_remote *remote, git_config *config, co
552
552
  }
553
553
  }
554
554
 
555
- git_buf_dispose(&buf);
555
+ git_buf_free(&buf);
556
556
  return error;
557
557
  }
558
558
 
@@ -601,8 +601,8 @@ static int set_url(git_repository *repo, const char *remote, const char *pattern
601
601
  }
602
602
 
603
603
  cleanup:
604
- git_buf_dispose(&canonical_url);
605
- git_buf_dispose(&buf);
604
+ git_buf_free(&canonical_url);
605
+ git_buf_free(&buf);
606
606
 
607
607
  return error;
608
608
  }
@@ -761,7 +761,7 @@ int git_remote__get_http_proxy(git_remote *remote, bool use_ssl, char **proxy_ur
761
761
  return error;
762
762
 
763
763
  error = git_config__lookup_entry(&ce, cfg, git_buf_cstr(&buf), false);
764
- git_buf_dispose(&buf);
764
+ git_buf_free(&buf);
765
765
 
766
766
  if (error < 0)
767
767
  return error;
@@ -826,7 +826,7 @@ static void free_refspecs(git_vector *vec)
826
826
  git_refspec *spec;
827
827
 
828
828
  git_vector_foreach(vec, i, spec) {
829
- git_refspec__dispose(spec);
829
+ git_refspec__free(spec);
830
830
  git__free(spec);
831
831
  }
832
832
 
@@ -985,7 +985,7 @@ int git_remote_fetch(
985
985
 
986
986
  /* Create "remote/foo" branches for all remote branches */
987
987
  error = git_remote_update_tips(remote, cbs, update_fetchhead, tagopt, git_buf_cstr(&reflog_msg_buf));
988
- git_buf_dispose(&reflog_msg_buf);
988
+ git_buf_free(&reflog_msg_buf);
989
989
  if (error < 0)
990
990
  return error;
991
991
 
@@ -1050,8 +1050,8 @@ static int ref_to_update(int *update, git_buf *remote_name, git_remote *remote,
1050
1050
  *update = 1;
1051
1051
  }
1052
1052
 
1053
- git_buf_dispose(&upstream_remote);
1054
- git_buf_dispose(&upstream_name);
1053
+ git_buf_free(&upstream_remote);
1054
+ git_buf_free(&upstream_name);
1055
1055
  return error;
1056
1056
  }
1057
1057
 
@@ -1084,7 +1084,7 @@ static int remote_head_for_ref(git_remote_head **out, git_remote *remote, git_re
1084
1084
  error = remote_head_for_fetchspec_src(out, update_heads, git_buf_cstr(&remote_name));
1085
1085
 
1086
1086
  cleanup:
1087
- git_buf_dispose(&remote_name);
1087
+ git_buf_free(&remote_name);
1088
1088
  git_reference_free(resolved_ref);
1089
1089
  git_config_free(config);
1090
1090
  return error;
@@ -1234,8 +1234,8 @@ int git_remote_prune(git_remote *remote, const git_remote_callbacks *callbacks)
1234
1234
  goto cleanup;
1235
1235
 
1236
1236
  key.name = (char *) git_buf_cstr(&buf);
1237
- error = git_vector_search(&pos, &remote_refs, &key);
1238
- git_buf_dispose(&buf);
1237
+ error = git_vector_bsearch(&pos, &remote_refs, &key);
1238
+ git_buf_free(&buf);
1239
1239
 
1240
1240
  if (error < 0 && error != GIT_ENOTFOUND)
1241
1241
  goto cleanup;
@@ -1416,14 +1416,14 @@ static int update_tips_for_spec(
1416
1416
  goto on_error;
1417
1417
 
1418
1418
  git_vector_free(&update_heads);
1419
- git_refspec__dispose(&tagspec);
1420
- git_buf_dispose(&refname);
1419
+ git_refspec__free(&tagspec);
1420
+ git_buf_free(&refname);
1421
1421
  return 0;
1422
1422
 
1423
1423
  on_error:
1424
1424
  git_vector_free(&update_heads);
1425
- git_refspec__dispose(&tagspec);
1426
- git_buf_dispose(&refname);
1425
+ git_refspec__free(&tagspec);
1426
+ git_buf_free(&refname);
1427
1427
  return -1;
1428
1428
 
1429
1429
  }
@@ -1537,7 +1537,7 @@ static int opportunistic_updates(const git_remote *remote, const git_remote_call
1537
1537
  error = 0;
1538
1538
 
1539
1539
  cleanup:
1540
- git_buf_dispose(&refname);
1540
+ git_buf_free(&refname);
1541
1541
  return error;
1542
1542
  }
1543
1543
 
@@ -1550,7 +1550,7 @@ static int truncate_fetch_head(const char *gitdir)
1550
1550
  return error;
1551
1551
 
1552
1552
  error = git_futils_truncate(path.ptr, GIT_REFS_FILE_MODE);
1553
- git_buf_dispose(&path);
1553
+ git_buf_free(&path);
1554
1554
 
1555
1555
  return error;
1556
1556
  }
@@ -1607,7 +1607,7 @@ int git_remote_update_tips(
1607
1607
 
1608
1608
  out:
1609
1609
  git_vector_free(&refs);
1610
- git_refspec__dispose(&tagspec);
1610
+ git_refspec__free(&tagspec);
1611
1611
  return error;
1612
1612
  }
1613
1613
 
@@ -1759,7 +1759,7 @@ int git_remote_set_autotag(git_repository *repo, const char *remote, git_remote_
1759
1759
  error = -1;
1760
1760
  }
1761
1761
 
1762
- git_buf_dispose(&var);
1762
+ git_buf_free(&var);
1763
1763
  return error;
1764
1764
  }
1765
1765
 
@@ -1790,8 +1790,8 @@ static int rename_remote_config_section(
1790
1790
  new_name ? git_buf_cstr(&new_section_name) : NULL);
1791
1791
 
1792
1792
  cleanup:
1793
- git_buf_dispose(&old_section_name);
1794
- git_buf_dispose(&new_section_name);
1793
+ git_buf_free(&old_section_name);
1794
+ git_buf_free(&new_section_name);
1795
1795
 
1796
1796
  return error;
1797
1797
  }
@@ -1887,10 +1887,10 @@ static int rename_one_remote_reference(
1887
1887
  cleanup:
1888
1888
  git_reference_free(reference_in);
1889
1889
  git_reference_free(ref);
1890
- git_buf_dispose(&namespace);
1891
- git_buf_dispose(&old_namespace);
1892
- git_buf_dispose(&new_name);
1893
- git_buf_dispose(&log_message);
1890
+ git_buf_free(&namespace);
1891
+ git_buf_free(&old_namespace);
1892
+ git_buf_free(&new_name);
1893
+ git_buf_free(&log_message);
1894
1894
  return error;
1895
1895
  }
1896
1896
 
@@ -1908,7 +1908,7 @@ static int rename_remote_references(
1908
1908
  return error;
1909
1909
 
1910
1910
  error = git_reference_iterator_glob_new(&iter, repo, git_buf_cstr(&buf));
1911
- git_buf_dispose(&buf);
1911
+ git_buf_free(&buf);
1912
1912
 
1913
1913
  if (error < 0)
1914
1914
  return error;
@@ -1976,9 +1976,9 @@ static int rename_fetch_refspecs(git_vector *problems, git_remote *remote, const
1976
1976
  break;
1977
1977
  }
1978
1978
 
1979
- git_buf_dispose(&base);
1980
- git_buf_dispose(&var);
1981
- git_buf_dispose(&val);
1979
+ git_buf_free(&base);
1980
+ git_buf_free(&var);
1981
+ git_buf_free(&val);
1982
1982
 
1983
1983
  if (error < 0) {
1984
1984
  char *str;
@@ -2044,8 +2044,8 @@ int git_remote_is_valid_name(
2044
2044
  git_buf_printf(&buf, "refs/heads/test:refs/remotes/%s/test", remote_name);
2045
2045
  error = git_refspec__parse(&refspec, git_buf_cstr(&buf), true);
2046
2046
 
2047
- git_buf_dispose(&buf);
2048
- git_refspec__dispose(&refspec);
2047
+ git_buf_free(&buf);
2048
+ git_refspec__free(&refspec);
2049
2049
 
2050
2050
  giterr_clear();
2051
2051
  return error == 0;
@@ -2219,7 +2219,7 @@ static int remove_branch_config_related_entries(
2219
2219
  if (error == GIT_ITEROVER)
2220
2220
  error = 0;
2221
2221
 
2222
- git_buf_dispose(&buf);
2222
+ git_buf_free(&buf);
2223
2223
  git_config_iterator_free(iter);
2224
2224
  return error;
2225
2225
  }