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
@@ -20,8 +20,6 @@
20
20
  #define GIT_INDEX_FILE "index"
21
21
  #define GIT_INDEX_FILE_MODE 0666
22
22
 
23
- extern bool git_index__enforce_unsaved_safety;
24
-
25
23
  struct git_index {
26
24
  git_refcount rc;
27
25
 
@@ -39,7 +37,6 @@ struct git_index {
39
37
  unsigned int ignore_case:1;
40
38
  unsigned int distrust_filemode:1;
41
39
  unsigned int no_symlinks:1;
42
- unsigned int dirty:1; /* whether we have unsaved changes */
43
40
 
44
41
  git_tree_cache *tree;
45
42
  git_pool tree_pool;
@@ -146,13 +143,6 @@ extern int git_index_snapshot_find(
146
143
  /* Replace an index with a new index */
147
144
  int git_index_read_index(git_index *index, const git_index *new_index);
148
145
 
149
- GIT_INLINE(int) git_index_is_dirty(git_index *index)
150
- {
151
- return index->dirty;
152
- }
153
-
154
- extern int git_index_read_safely(git_index *index);
155
-
156
146
  typedef struct {
157
147
  git_index *index;
158
148
  git_filebuf file;
@@ -134,12 +134,12 @@ int git_indexer_new(
134
134
  goto cleanup;
135
135
 
136
136
  fd = git_futils_mktmp(&tmp_path, git_buf_cstr(&path), idx->mode);
137
- git_buf_dispose(&path);
137
+ git_buf_free(&path);
138
138
  if (fd < 0)
139
139
  goto cleanup;
140
140
 
141
141
  error = git_packfile_alloc(&idx->pack, git_buf_cstr(&tmp_path));
142
- git_buf_dispose(&tmp_path);
142
+ git_buf_free(&tmp_path);
143
143
 
144
144
  if (error < 0)
145
145
  goto cleanup;
@@ -161,8 +161,8 @@ cleanup:
161
161
  if (idx->pack != NULL)
162
162
  p_unlink(idx->pack->pack_name);
163
163
 
164
- git_buf_dispose(&path);
165
- git_buf_dispose(&tmp_path);
164
+ git_buf_free(&path);
165
+ git_buf_free(&tmp_path);
166
166
  git__free(idx);
167
167
  return -1;
168
168
  }
@@ -650,7 +650,7 @@ int git_indexer_append(git_indexer *idx, const void *data, size_t size, git_tran
650
650
 
651
651
  /* We want to free the stream reasorces no matter what here */
652
652
  idx->have_stream = 0;
653
- git_packfile_stream_dispose(stream);
653
+ git_packfile_stream_free(stream);
654
654
 
655
655
  if (error < 0)
656
656
  goto on_error;
@@ -758,7 +758,7 @@ static int inject_object(git_indexer *idx, git_oid *id)
758
758
 
759
759
  idx->pack->mwf.size += buf.size;
760
760
  entry->crc = htonl(crc32(entry->crc, (unsigned char *)buf.ptr, (uInt)buf.size));
761
- git_buf_dispose(&buf);
761
+ git_buf_free(&buf);
762
762
 
763
763
  /* Write a fake trailer so the pack functions play ball */
764
764
 
@@ -1121,13 +1121,13 @@ int git_indexer_commit(git_indexer *idx, git_transfer_progress *stats)
1121
1121
 
1122
1122
  idx->pack_committed = 1;
1123
1123
 
1124
- git_buf_dispose(&filename);
1124
+ git_buf_free(&filename);
1125
1125
  return 0;
1126
1126
 
1127
1127
  on_error:
1128
1128
  git_mwindow_free_all(&idx->pack->mwf);
1129
1129
  git_filebuf_cleanup(&index_file);
1130
- git_buf_dispose(&filename);
1130
+ git_buf_free(&filename);
1131
1131
  return -1;
1132
1132
  }
1133
1133
 
@@ -1137,7 +1137,7 @@ void git_indexer_free(git_indexer *idx)
1137
1137
  return;
1138
1138
 
1139
1139
  if (idx->have_stream)
1140
- git_packfile_stream_dispose(&idx->stream);
1140
+ git_packfile_stream_free(&idx->stream);
1141
1141
 
1142
1142
  git_vector_free_deep(&idx->objects);
1143
1143
 
@@ -701,7 +701,7 @@ static void tree_iterator_frame_pop(tree_iterator *iter)
701
701
 
702
702
  do {
703
703
  buf = git_array_pop(frame->similar_paths);
704
- git_buf_dispose(buf);
704
+ git_buf_free(buf);
705
705
  } while (buf != NULL);
706
706
 
707
707
  git_array_clear(frame->similar_paths);
@@ -711,7 +711,7 @@ static void tree_iterator_frame_pop(tree_iterator *iter)
711
711
 
712
712
  git_vector_free(&frame->similar_trees);
713
713
 
714
- git_buf_dispose(&frame->path);
714
+ git_buf_free(&frame->path);
715
715
  }
716
716
 
717
717
  static int tree_iterator_current(
@@ -929,7 +929,7 @@ static void tree_iterator_free(git_iterator *i)
929
929
  tree_iterator_clear(iter);
930
930
 
931
931
  git_tree_free(iter->root);
932
- git_buf_dispose(&iter->entry_path);
932
+ git_buf_free(&iter->entry_path);
933
933
  }
934
934
 
935
935
  int git_iterator_for_tree(
@@ -1435,7 +1435,7 @@ done:
1435
1435
  if (error < 0)
1436
1436
  git_array_pop(iter->frames);
1437
1437
 
1438
- git_buf_dispose(&root);
1438
+ git_buf_free(&root);
1439
1439
  git_path_diriter_free(&diriter);
1440
1440
  return error;
1441
1441
  }
@@ -1523,7 +1523,7 @@ static int filesystem_iterator_is_dir(
1523
1523
  *is_dir = S_ISDIR(st.st_mode);
1524
1524
 
1525
1525
  done:
1526
- git_buf_dispose(&fullpath);
1526
+ git_buf_free(&fullpath);
1527
1527
  return error;
1528
1528
  }
1529
1529
 
@@ -1804,7 +1804,7 @@ static void filesystem_iterator_clear(filesystem_iterator *iter)
1804
1804
  git_array_clear(iter->frames);
1805
1805
  git_ignore__free(&iter->ignores);
1806
1806
 
1807
- git_buf_dispose(&iter->tmp_buf);
1807
+ git_buf_free(&iter->tmp_buf);
1808
1808
 
1809
1809
  iterator_clear(&iter->base);
1810
1810
  }
@@ -1838,7 +1838,7 @@ static void filesystem_iterator_free(git_iterator *i)
1838
1838
  {
1839
1839
  filesystem_iterator *iter = (filesystem_iterator *)i;
1840
1840
  git__free(iter->root);
1841
- git_buf_dispose(&iter->current_path);
1841
+ git_buf_free(&iter->current_path);
1842
1842
  git_tree_free(iter->tree);
1843
1843
  if (iter->index)
1844
1844
  git_index_snapshot_release(&iter->index_snapshot, iter->index);
@@ -2176,7 +2176,7 @@ static void index_iterator_free(git_iterator *i)
2176
2176
  index_iterator *iter = (index_iterator *)i;
2177
2177
 
2178
2178
  git_index_snapshot_release(&iter->entries, iter->base.index);
2179
- git_buf_dispose(&iter->tree_buf);
2179
+ git_buf_free(&iter->tree_buf);
2180
2180
  }
2181
2181
 
2182
2182
  int git_iterator_for_index(
@@ -146,10 +146,8 @@ typedef unsigned long long khint64_t;
146
146
  #ifndef kh_inline
147
147
  #ifdef _MSC_VER
148
148
  #define kh_inline __inline
149
- #elif defined(__GNUC__)
150
- #define kh_inline __inline__
151
149
  #else
152
- #define kh_inline
150
+ #define kh_inline inline
153
151
  #endif
154
152
  #endif /* kh_inline */
155
153
 
@@ -599,8 +599,8 @@ int git_repository_mergehead_foreach(
599
599
  }
600
600
 
601
601
  cleanup:
602
- git_buf_dispose(&merge_head_path);
603
- git_buf_dispose(&merge_head_file);
602
+ git_buf_free(&merge_head_path);
603
+ git_buf_free(&merge_head_file);
604
604
 
605
605
  return error;
606
606
  }
@@ -875,7 +875,7 @@ static int merge_conflict_invoke_driver(
875
875
  *out = result;
876
876
 
877
877
  done:
878
- git_buf_dispose(&buf);
878
+ git_buf_free(&buf);
879
879
  git_odb_free(odb);
880
880
 
881
881
  return error;
@@ -2444,7 +2444,7 @@ cleanup:
2444
2444
  if (error < 0)
2445
2445
  git_filebuf_cleanup(&file);
2446
2446
 
2447
- git_buf_dispose(&file_path);
2447
+ git_buf_free(&file_path);
2448
2448
 
2449
2449
  return error;
2450
2450
  }
@@ -2470,7 +2470,7 @@ cleanup:
2470
2470
  if (error < 0)
2471
2471
  git_filebuf_cleanup(&file);
2472
2472
 
2473
- git_buf_dispose(&file_path);
2473
+ git_buf_free(&file_path);
2474
2474
 
2475
2475
  return error;
2476
2476
  }
@@ -2770,7 +2770,7 @@ cleanup:
2770
2770
  if (error < 0)
2771
2771
  git_filebuf_cleanup(&file);
2772
2772
 
2773
- git_buf_dispose(&file_path);
2773
+ git_buf_free(&file_path);
2774
2774
 
2775
2775
  git_vector_free(&matching);
2776
2776
  git__free(entries);
@@ -3090,7 +3090,7 @@ cleanup:
3090
3090
  if (error < 0)
3091
3091
  git_filebuf_cleanup(&file);
3092
3092
 
3093
- git_buf_dispose(&file_path);
3093
+ git_buf_free(&file_path);
3094
3094
 
3095
3095
  return error;
3096
3096
  }
@@ -292,10 +292,10 @@ int gitno_extract_url_parts(
292
292
  *password_out = git_buf_detach(&password);
293
293
 
294
294
  done:
295
- git_buf_dispose(&host);
296
- git_buf_dispose(&port);
297
- git_buf_dispose(&path);
298
- git_buf_dispose(&username);
299
- git_buf_dispose(&password);
295
+ git_buf_free(&host);
296
+ git_buf_free(&port);
297
+ git_buf_free(&path);
298
+ git_buf_free(&username);
299
+ git_buf_free(&password);
300
300
  return error;
301
301
  }
@@ -285,7 +285,7 @@ static int note_write(
285
285
  git_oid oid;
286
286
  git_tree *tree = NULL;
287
287
 
288
- /* TODO: should we apply filters? */
288
+ // TODO: should we apply filters?
289
289
  /* create note object */
290
290
  if ((error = git_blob_create_frombuffer(&oid, repo, note, strlen(note))) < 0)
291
291
  goto cleanup;
@@ -710,7 +710,7 @@ static int process_entry_path(
710
710
  error = git_oid_fromstr(annotated_object_id, buf.ptr);
711
711
 
712
712
  cleanup:
713
- git_buf_dispose(&buf);
713
+ git_buf_free(&buf);
714
714
  return error;
715
715
  }
716
716
 
@@ -260,12 +260,12 @@ int git_odb__hashfd_filtered(
260
260
 
261
261
  error = git_filter_list_apply_to_data(&post, fl, &raw);
262
262
 
263
- git_buf_dispose(&raw);
263
+ git_buf_free(&raw);
264
264
 
265
265
  if (!error)
266
266
  error = git_odb_hash(out, post.ptr, post.size, type);
267
267
 
268
- git_buf_dispose(&post);
268
+ git_buf_free(&post);
269
269
  }
270
270
 
271
271
  return error;
@@ -588,12 +588,12 @@ static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_
588
588
  return -1;
589
589
 
590
590
  if (git_path_exists(alternates_path.ptr) == false) {
591
- git_buf_dispose(&alternates_path);
591
+ git_buf_free(&alternates_path);
592
592
  return 0;
593
593
  }
594
594
 
595
595
  if (git_futils_readbuffer(&alternates_buf, alternates_path.ptr) < 0) {
596
- git_buf_dispose(&alternates_path);
596
+ git_buf_free(&alternates_path);
597
597
  return -1;
598
598
  }
599
599
 
@@ -619,8 +619,8 @@ static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_
619
619
  break;
620
620
  }
621
621
 
622
- git_buf_dispose(&alternates_path);
623
- git_buf_dispose(&alternates_buf);
622
+ git_buf_free(&alternates_path);
623
+ git_buf_free(&alternates_buf);
624
624
 
625
625
  return result;
626
626
  }
@@ -1181,7 +1181,7 @@ static int read_prefix_1(git_odb_object **out, git_odb *db,
1181
1181
  git_oid_tostr_s(&found_full_oid));
1182
1182
 
1183
1183
  error = git_odb__error_ambiguous(buf.ptr);
1184
- git_buf_dispose(&buf);
1184
+ git_buf_free(&buf);
1185
1185
  goto out;
1186
1186
  }
1187
1187
 
@@ -1384,8 +1384,8 @@ static int git_odb_stream__invalid_length(
1384
1384
  {
1385
1385
  giterr_set(GITERR_ODB,
1386
1386
  "cannot %s - "
1387
- "Invalid length. %"PRIdZ" was expected. The "
1388
- "total size of the received chunks amounts to %"PRIdZ".",
1387
+ "Invalid length. %"PRId64" was expected. The "
1388
+ "total size of the received chunks amounts to %"PRId64".",
1389
1389
  action, stream->declared_size, stream->received_bytes);
1390
1390
 
1391
1391
  return -1;
@@ -266,7 +266,7 @@ static int read_loose_packlike(git_rawobj *out, git_buf *obj)
266
266
  out->data = git_buf_detach(&body);
267
267
 
268
268
  done:
269
- git_buf_dispose(&body);
269
+ git_buf_free(&body);
270
270
  return error;
271
271
  }
272
272
 
@@ -362,7 +362,7 @@ static int read_loose(git_rawobj *out, git_buf *loc)
362
362
  error = read_loose_standard(out, &obj);
363
363
 
364
364
  done:
365
- git_buf_dispose(&obj);
365
+ git_buf_free(&obj);
366
366
  return error;
367
367
  }
368
368
 
@@ -593,7 +593,7 @@ static int loose_backend__read_header(size_t *len_p, git_otype *type_p, git_odb_
593
593
  *type_p = raw.type;
594
594
  }
595
595
 
596
- git_buf_dispose(&object_path);
596
+ git_buf_free(&object_path);
597
597
 
598
598
  return error;
599
599
  }
@@ -615,7 +615,7 @@ static int loose_backend__read(void **buffer_p, size_t *len_p, git_otype *type_p
615
615
  *type_p = raw.type;
616
616
  }
617
617
 
618
- git_buf_dispose(&object_path);
618
+ git_buf_free(&object_path);
619
619
 
620
620
  return error;
621
621
  }
@@ -653,7 +653,7 @@ static int loose_backend__read_prefix(
653
653
  *type_p = raw.type;
654
654
  }
655
655
 
656
- git_buf_dispose(&object_path);
656
+ git_buf_free(&object_path);
657
657
  }
658
658
 
659
659
  return error;
@@ -668,7 +668,7 @@ static int loose_backend__exists(git_odb_backend *backend, const git_oid *oid)
668
668
 
669
669
  error = locate_object(&object_path, (loose_backend *)backend, oid);
670
670
 
671
- git_buf_dispose(&object_path);
671
+ git_buf_free(&object_path);
672
672
 
673
673
  return !error;
674
674
  }
@@ -684,7 +684,7 @@ static int loose_backend__exists_prefix(
684
684
  error = locate_object_short_oid(
685
685
  &object_path, out, (loose_backend *)backend, short_id, len);
686
686
 
687
- git_buf_dispose(&object_path);
687
+ git_buf_free(&object_path);
688
688
 
689
689
  return error;
690
690
  }
@@ -770,7 +770,7 @@ static int loose_backend__foreach(git_odb_backend *_backend, git_odb_foreach_cb
770
770
 
771
771
  error = git_path_direach(&buf, 0, foreach_cb, &state);
772
772
 
773
- git_buf_dispose(&buf);
773
+ git_buf_free(&buf);
774
774
 
775
775
  return error;
776
776
  }
@@ -789,7 +789,7 @@ static int loose_backend__writestream_finalize(git_odb_stream *_stream, const gi
789
789
  error = git_filebuf_commit_at(
790
790
  &stream->fbuf, final_path.ptr);
791
791
 
792
- git_buf_dispose(&final_path);
792
+ git_buf_free(&final_path);
793
793
 
794
794
  return error;
795
795
  }
@@ -856,7 +856,7 @@ static int loose_backend__writestream(git_odb_stream **stream_out, git_odb_backe
856
856
  git__free(stream);
857
857
  stream = NULL;
858
858
  }
859
- git_buf_dispose(&tmp_path);
859
+ git_buf_free(&tmp_path);
860
860
  *stream_out = (git_odb_stream *)stream;
861
861
 
862
862
  return !stream ? -1 : 0;
@@ -1028,14 +1028,18 @@ static int loose_backend__readstream(
1028
1028
 
1029
1029
  done:
1030
1030
  if (error < 0) {
1031
- git_futils_mmap_free(&stream->map);
1032
- git_zstream_free(&stream->zstream);
1033
- git_hash_ctx_cleanup(hash_ctx);
1034
- git__free(hash_ctx);
1035
- git__free(stream);
1031
+ if (stream) {
1032
+ git_futils_mmap_free(&stream->map);
1033
+ git_zstream_free(&stream->zstream);
1034
+ git__free(stream);
1035
+ }
1036
+ if (hash_ctx) {
1037
+ git_hash_ctx_cleanup(hash_ctx);
1038
+ git__free(hash_ctx);
1039
+ }
1036
1040
  }
1037
1041
 
1038
- git_buf_dispose(&object_path);
1042
+ git_buf_free(&object_path);
1039
1043
  return error;
1040
1044
  }
1041
1045
 
@@ -1074,7 +1078,7 @@ static int loose_backend__write(git_odb_backend *_backend, const git_oid *oid, c
1074
1078
  cleanup:
1075
1079
  if (error < 0)
1076
1080
  git_filebuf_cleanup(&fbuf);
1077
- git_buf_dispose(&final_path);
1081
+ git_buf_free(&final_path);
1078
1082
  return error;
1079
1083
  }
1080
1084
 
@@ -1090,7 +1094,7 @@ static int loose_backend__freshen(
1090
1094
  return -1;
1091
1095
 
1092
1096
  error = git_futils_touch(path.ptr, NULL);
1093
- git_buf_dispose(&path);
1097
+ git_buf_free(&path);
1094
1098
 
1095
1099
  return error;
1096
1100
  }