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
@@ -130,15 +130,15 @@ end_parse:
130
130
 
131
131
  if (line[rpos] != '"' || line[rpos + 1] != ']') {
132
132
  set_parse_error(reader, rpos, "Unexpected text after closing quotes");
133
- git_buf_dispose(&buf);
133
+ git_buf_free(&buf);
134
134
  return -1;
135
135
  }
136
136
 
137
137
  *section_name = git_buf_detach(&buf);
138
- return base_name_len + 1 /* SP */ + 1 /* " */ + rpos + 1 /* " */ + 1 /* ] */;
138
+ return 0;
139
139
 
140
140
  end_error:
141
- git_buf_dispose(&buf);
141
+ git_buf_free(&buf);
142
142
 
143
143
  return -1;
144
144
  }
@@ -205,7 +205,7 @@ static int parse_section_header(git_config_parser *reader, char **section_out)
205
205
  name[name_length] = 0;
206
206
  *section_out = name;
207
207
 
208
- return pos;
208
+ return 0;
209
209
 
210
210
  fail_parse:
211
211
  git__free(line);
@@ -315,49 +315,51 @@ done:
315
315
 
316
316
  static int parse_multiline_variable(git_config_parser *reader, git_buf *value, int in_quotes)
317
317
  {
318
- char *line = NULL, *proc_line = NULL;
319
318
  int quote_count;
320
- bool multiline;
319
+ bool multiline = true;
321
320
 
322
- /* Check that the next line exists */
323
- git_parse_advance_line(&reader->ctx);
324
- line = git__strndup(reader->ctx.line, reader->ctx.line_len);
325
- if (line == NULL)
326
- return -1;
321
+ while (multiline) {
322
+ char *line = NULL, *proc_line = NULL;
323
+ int error;
327
324
 
328
- /* We've reached the end of the file, there is no continuation.
329
- * (this is not an error).
330
- */
331
- if (line[0] == '\0') {
332
- git__free(line);
333
- return 0;
334
- }
325
+ /* Check that the next line exists */
326
+ git_parse_advance_line(&reader->ctx);
327
+ line = git__strndup(reader->ctx.line, reader->ctx.line_len);
328
+ GITERR_CHECK_ALLOC(line);
329
+
330
+ /*
331
+ * We've reached the end of the file, there is no continuation.
332
+ * (this is not an error).
333
+ */
334
+ if (line[0] == '\0') {
335
+ error = 0;
336
+ goto out;
337
+ }
338
+
339
+ /* If it was just a comment, pretend it didn't exist */
340
+ quote_count = strip_comments(line, !!in_quotes);
341
+ if (line[0] == '\0')
342
+ goto next;
335
343
 
336
- quote_count = strip_comments(line, !!in_quotes);
344
+ if ((error = unescape_line(&proc_line, &multiline,
345
+ line, in_quotes)) < 0)
346
+ goto out;
347
+
348
+ /* Add this line to the multiline var */
349
+ if ((error = git_buf_puts(value, proc_line)) < 0)
350
+ goto out;
337
351
 
338
- /* If it was just a comment, pretend it didn't exist */
339
- if (line[0] == '\0') {
352
+ next:
340
353
  git__free(line);
341
- return parse_multiline_variable(reader, value, quote_count);
342
- /* TODO: unbounded recursion. This **could** be exploitable */
343
- }
354
+ git__free(proc_line);
355
+ in_quotes = quote_count;
356
+ continue;
344
357
 
345
- if (unescape_line(&proc_line, &multiline, line, in_quotes) < 0) {
358
+ out:
346
359
  git__free(line);
347
- return -1;
360
+ git__free(proc_line);
361
+ return error;
348
362
  }
349
- /* add this line to the multiline var */
350
-
351
- git_buf_puts(value, proc_line);
352
- git__free(line);
353
- git__free(proc_line);
354
-
355
- /*
356
- * If we need to continue reading the next line, let's just
357
- * keep putting stuff in the buffer
358
- */
359
- if (multiline)
360
- return parse_multiline_variable(reader, value, quote_count);
361
363
 
362
364
  return 0;
363
365
  }
@@ -404,21 +406,22 @@ static int parse_name(
404
406
  static int parse_variable(git_config_parser *reader, char **var_name, char **var_value)
405
407
  {
406
408
  const char *value_start = NULL;
407
- char *line = NULL, *name = NULL, *value = NULL;
408
- int quote_count, error;
409
+ char *line;
410
+ int quote_count;
409
411
  bool multiline;
410
412
 
411
- *var_name = NULL;
412
- *var_value = NULL;
413
-
414
413
  git_parse_advance_ws(&reader->ctx);
415
414
  line = git__strndup(reader->ctx.line, reader->ctx.line_len);
416
- GITERR_CHECK_ALLOC(line);
415
+ if (line == NULL)
416
+ return -1;
417
417
 
418
418
  quote_count = strip_comments(line, 0);
419
419
 
420
- if ((error = parse_name(&name, &value_start, reader, line)) < 0)
421
- goto out;
420
+ /* If there is no value, boolean true is assumed */
421
+ *var_value = NULL;
422
+
423
+ if (parse_name(var_name, &value_start, reader, line) < 0)
424
+ goto on_error;
422
425
 
423
426
  /*
424
427
  * Now, let's try to parse the value
@@ -427,34 +430,30 @@ static int parse_variable(git_config_parser *reader, char **var_name, char **var
427
430
  while (git__isspace(value_start[0]))
428
431
  value_start++;
429
432
 
430
- if ((error = unescape_line(&value, &multiline, value_start, 0)) < 0)
431
- goto out;
433
+ if (unescape_line(var_value, &multiline, value_start, 0) < 0)
434
+ goto on_error;
432
435
 
433
436
  if (multiline) {
434
437
  git_buf multi_value = GIT_BUF_INIT;
435
- git_buf_attach(&multi_value, value, 0);
438
+ git_buf_attach(&multi_value, *var_value, 0);
436
439
 
437
440
  if (parse_multiline_variable(reader, &multi_value, quote_count) < 0 ||
438
- git_buf_oom(&multi_value)) {
439
- error = -1;
440
- git_buf_dispose(&multi_value);
441
- goto out;
441
+ git_buf_oom(&multi_value)) {
442
+ git_buf_free(&multi_value);
443
+ goto on_error;
442
444
  }
443
445
 
444
- value = git_buf_detach(&multi_value);
446
+ *var_value = git_buf_detach(&multi_value);
445
447
  }
446
448
  }
447
449
 
448
- *var_name = name;
449
- *var_value = value;
450
- name = NULL;
451
- value = NULL;
450
+ git__free(line);
451
+ return 0;
452
452
 
453
- out:
454
- git__free(name);
455
- git__free(value);
453
+ on_error:
454
+ git__free(*var_name);
456
455
  git__free(line);
457
- return error;
456
+ return -1;
458
457
  }
459
458
 
460
459
  int git_config_parse(
@@ -466,7 +465,7 @@ int git_config_parse(
466
465
  void *data)
467
466
  {
468
467
  git_parse_ctx *ctx;
469
- char *current_section = NULL, *var_name = NULL, *var_value = NULL;
468
+ char *current_section = NULL, *var_name, *var_value;
470
469
  int result = 0;
471
470
 
472
471
  ctx = &parser->ctx;
@@ -474,14 +473,10 @@ int git_config_parse(
474
473
  skip_bom(ctx);
475
474
 
476
475
  for (; ctx->remain_len > 0; git_parse_advance_line(ctx)) {
477
- const char *line_start;
478
- size_t line_len;
476
+ const char *line_start = parser->ctx.line;
477
+ size_t line_len = parser->ctx.line_len;
479
478
  char c;
480
479
 
481
- restart:
482
- line_start = ctx->line;
483
- line_len = ctx->line_len;
484
-
485
480
  /*
486
481
  * Get either first non-whitespace character or, if that does
487
482
  * not exist, the first whitespace character. This is required
@@ -496,24 +491,9 @@ int git_config_parse(
496
491
  git__free(current_section);
497
492
  current_section = NULL;
498
493
 
499
- result = parse_section_header(parser, &current_section);
500
- if (result < 0)
501
- break;
502
-
503
- git_parse_advance_chars(ctx, result);
504
-
505
- if (on_section)
494
+ if ((result = parse_section_header(parser, &current_section)) == 0 && on_section) {
506
495
  result = on_section(parser, current_section, line_start, line_len, data);
507
- /*
508
- * After we've parsed the section header we may not be
509
- * done with the line. If there's still data in there,
510
- * run the next loop with the rest of the current line
511
- * instead of moving forward.
512
- */
513
-
514
- if (!git_parse_peek(&c, ctx, GIT_PARSE_PEEK_SKIP_WHITESPACE))
515
- goto restart;
516
-
496
+ }
517
497
  break;
518
498
 
519
499
  case '\n': /* comment or whitespace-only */
@@ -530,10 +510,7 @@ int git_config_parse(
530
510
  default: /* assume variable declaration */
531
511
  if ((result = parse_variable(parser, &var_name, &var_value)) == 0 && on_variable) {
532
512
  result = on_variable(parser, current_section, var_name, var_value, line_start, line_len, data);
533
- git__free(var_name);
534
- git__free(var_value);
535
513
  }
536
-
537
514
  break;
538
515
  }
539
516
 
@@ -36,8 +36,8 @@ typedef int (*git_config_parser_section_cb)(
36
36
  typedef int (*git_config_parser_variable_cb)(
37
37
  git_config_parser *parser,
38
38
  const char *current_section,
39
- const char *var_name,
40
- const char *var_value,
39
+ char *var_name,
40
+ char *var_value,
41
41
  const char *line,
42
42
  size_t line_len,
43
43
  void *data);
@@ -71,9 +71,6 @@ static int crlf_input_action(struct crlf_attrs *ca)
71
71
  if (ca->eol == GIT_EOL_LF)
72
72
  return GIT_CRLF_INPUT;
73
73
 
74
- if (ca->crlf_action == GIT_CRLF_AUTO)
75
- return GIT_CRLF_AUTO;
76
-
77
74
  if (ca->eol == GIT_EOL_CRLF)
78
75
  return GIT_CRLF_CRLF;
79
76
 
@@ -203,8 +200,6 @@ static const char *line_ending(struct crlf_attrs *ca)
203
200
  break;
204
201
 
205
202
  case GIT_CRLF_AUTO:
206
- if (ca->eol == GIT_EOL_CRLF)
207
- return "\r\n";
208
203
  case GIT_CRLF_TEXT:
209
204
  break;
210
205
 
@@ -258,7 +253,8 @@ static int crlf_apply_to_workdir(
258
253
  ca->crlf_action == GIT_CRLF_GUESS) {
259
254
 
260
255
  /* If we have any existing CR or CRLF line endings, do nothing */
261
- if (stats.cr > 0 && stats.crlf > 0)
256
+ if (ca->crlf_action == GIT_CRLF_GUESS &&
257
+ stats.cr > 0 && stats.crlf > 0)
262
258
  return GIT_PASSTHROUGH;
263
259
 
264
260
  /* If we have bare CR characters, do nothing */
@@ -306,8 +302,7 @@ static int crlf_check(
306
302
  return GIT_PASSTHROUGH;
307
303
 
308
304
  if (ca.crlf_action == GIT_CRLF_GUESS ||
309
- ((ca.crlf_action == GIT_CRLF_AUTO ||
310
- ca.crlf_action == GIT_CRLF_TEXT) &&
305
+ ((ca.crlf_action == GIT_CRLF_AUTO || ca.crlf_action == GIT_CRLF_TEXT) &&
311
306
  git_filter_source_mode(src) == GIT_FILTER_SMUDGE)) {
312
307
 
313
308
  error = git_repository__cvar(
@@ -320,7 +315,6 @@ static int crlf_check(
320
315
  return GIT_PASSTHROUGH;
321
316
 
322
317
  if (ca.auto_crlf == GIT_AUTO_CRLF_INPUT &&
323
- ca.eol != GIT_EOL_CRLF &&
324
318
  git_filter_source_mode(src) == GIT_FILTER_SMUDGE)
325
319
  return GIT_PASSTHROUGH;
326
320
  }
@@ -439,7 +439,7 @@ static int file_cb(
439
439
  goto out;
440
440
 
441
441
  out:
442
- git_buf_dispose(&buf);
442
+ git_buf_free(&buf);
443
443
  return error;
444
444
  }
445
445
 
@@ -477,7 +477,7 @@ static int line_cb(
477
477
  goto out;
478
478
 
479
479
  out:
480
- git_buf_dispose(&buf);
480
+ git_buf_free(&buf);
481
481
  return error;
482
482
  }
483
483
 
@@ -121,7 +121,7 @@ static int diff_driver_add_patterns(
121
121
 
122
122
  if (error && pat != NULL)
123
123
  (void)git_array_pop(drv->fn_patterns); /* release last item */
124
- git_buf_dispose(&buf);
124
+ git_buf_free(&buf);
125
125
 
126
126
  /* We want to ignore bad patterns, so return success regardless */
127
127
  return 0;
@@ -338,7 +338,7 @@ static int git_diff_driver_load(
338
338
 
339
339
  done:
340
340
  git_config_entry_free(ce);
341
- git_buf_dispose(&name);
341
+ git_buf_free(&name);
342
342
  git_config_free(cfg);
343
343
 
344
344
  if (!*out) {
@@ -516,7 +516,7 @@ void git_diff_find_context_init(
516
516
  void git_diff_find_context_clear(git_diff_find_context_payload *payload)
517
517
  {
518
518
  if (payload) {
519
- git_buf_dispose(&payload->line);
519
+ git_buf_free(&payload->line);
520
520
  payload->driver = NULL;
521
521
  }
522
522
  }
@@ -280,7 +280,7 @@ static int diff_file_content_load_workdir_symlink_fake(
280
280
  fc->map.data = git_buf_detach(&target);
281
281
  fc->flags |= GIT_DIFF_FLAG__FREE_DATA;
282
282
 
283
- git_buf_dispose(&target);
283
+ git_buf_free(&target);
284
284
  return error;
285
285
  }
286
286
 
@@ -361,7 +361,7 @@ static int diff_file_content_load_workdir_file(
361
361
  error = git_filter_list_apply_to_data(&out, fl, &raw);
362
362
 
363
363
  if (out.ptr != raw.ptr)
364
- git_buf_dispose(&raw);
364
+ git_buf_free(&raw);
365
365
 
366
366
  if (!error) {
367
367
  fc->map.len = out.size;
@@ -406,7 +406,7 @@ static int diff_file_content_load_workdir(
406
406
  fc->file->flags |= GIT_DIFF_FLAG_VALID_ID;
407
407
  }
408
408
 
409
- git_buf_dispose(&path);
409
+ git_buf_free(&path);
410
410
  return error;
411
411
  }
412
412
 
@@ -273,8 +273,7 @@ static git_diff_delta *diff_delta__last_for_item(
273
273
  break;
274
274
  case GIT_DELTA_MODIFIED:
275
275
  if (git_oid__cmp(&delta->old_file.id, &item->id) == 0 ||
276
- (delta->new_file.mode == item->mode &&
277
- git_oid__cmp(&delta->new_file.id, &item->id) == 0))
276
+ git_oid__cmp(&delta->new_file.id, &item->id) == 0)
278
277
  return delta;
279
278
  break;
280
279
  default:
@@ -601,7 +600,7 @@ int git_diff__oid_for_entry(
601
600
 
602
601
  if (p_stat(full_path.ptr, &st) < 0) {
603
602
  error = git_path_set_error(errno, entry.path, "stat");
604
- git_buf_dispose(&full_path);
603
+ git_buf_free(&full_path);
605
604
  return error;
606
605
  }
607
606
 
@@ -664,7 +663,7 @@ int git_diff__oid_for_entry(
664
663
  }
665
664
  }
666
665
 
667
- git_buf_dispose(&full_path);
666
+ git_buf_free(&full_path);
668
667
  return error;
669
668
  }
670
669
 
@@ -373,8 +373,8 @@ int diff_delta_format_similarity_header(
373
373
  error = -1;
374
374
 
375
375
  done:
376
- git_buf_dispose(&old_path);
377
- git_buf_dispose(&new_path);
376
+ git_buf_free(&old_path);
377
+ git_buf_free(&new_path);
378
378
 
379
379
  return error;
380
380
  }
@@ -446,8 +446,8 @@ int git_diff_delta__format_file_header(
446
446
  error = -1;
447
447
 
448
448
  done:
449
- git_buf_dispose(&old_path);
450
- git_buf_dispose(&new_path);
449
+ git_buf_free(&old_path);
450
+ git_buf_free(&new_path);
451
451
 
452
452
  return error;
453
453
  }
@@ -509,8 +509,8 @@ static int diff_print_patch_file_binary_noshow(
509
509
  old_path.ptr, new_path.ptr);
510
510
 
511
511
  done:
512
- git_buf_dispose(&old_path);
513
- git_buf_dispose(&new_path);
512
+ git_buf_free(&old_path);
513
+ git_buf_free(&new_path);
514
514
 
515
515
  return error;
516
516
  }
@@ -696,7 +696,7 @@ int git_diff_print(
696
696
  giterr_set_after_callback_function(error, "git_diff_print");
697
697
  }
698
698
 
699
- git_buf_dispose(&buf);
699
+ git_buf_free(&buf);
700
700
 
701
701
  return error;
702
702
  }
@@ -776,7 +776,7 @@ int git_patch_print(
776
776
  giterr_set_after_callback_function(error, "git_patch_print");
777
777
  }
778
778
 
779
- git_buf_dispose(&temp);
779
+ git_buf_free(&temp);
780
780
 
781
781
  return error;
782
782
  }