rugged 1.5.1 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rugged/extconf.rb +2 -2
  3. data/ext/rugged/rugged_blame.c +2 -0
  4. data/ext/rugged/rugged_blob.c +3 -0
  5. data/ext/rugged/rugged_commit.c +1 -0
  6. data/ext/rugged/rugged_config.c +2 -0
  7. data/ext/rugged/rugged_diff.c +1 -0
  8. data/ext/rugged/rugged_index.c +2 -0
  9. data/ext/rugged/rugged_patch.c +1 -0
  10. data/ext/rugged/rugged_rebase.c +1 -0
  11. data/ext/rugged/rugged_reference.c +1 -0
  12. data/ext/rugged/rugged_remote.c +1 -0
  13. data/ext/rugged/rugged_repo.c +5 -2
  14. data/ext/rugged/rugged_revwalk.c +5 -1
  15. data/ext/rugged/rugged_submodule.c +1 -0
  16. data/ext/rugged/rugged_tag.c +1 -0
  17. data/ext/rugged/rugged_tree.c +4 -0
  18. data/lib/rugged/index.rb +1 -1
  19. data/lib/rugged/tree.rb +1 -1
  20. data/lib/rugged/version.rb +1 -1
  21. data/vendor/libgit2/CMakeLists.txt +5 -1
  22. data/vendor/libgit2/COPYING +30 -0
  23. data/vendor/libgit2/cmake/ExperimentalFeatures.cmake +23 -0
  24. data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +2 -0
  25. data/vendor/libgit2/include/git2/common.h +13 -6
  26. data/vendor/libgit2/include/git2/deprecated.h +6 -0
  27. data/vendor/libgit2/include/git2/diff.h +1 -1
  28. data/vendor/libgit2/include/git2/experimental.h +20 -0
  29. data/vendor/libgit2/include/git2/indexer.h +29 -0
  30. data/vendor/libgit2/include/git2/object.h +28 -2
  31. data/vendor/libgit2/include/git2/odb.h +58 -7
  32. data/vendor/libgit2/include/git2/odb_backend.h +106 -18
  33. data/vendor/libgit2/include/git2/oid.h +115 -15
  34. data/vendor/libgit2/include/git2/repository.h +20 -1
  35. data/vendor/libgit2/include/git2/stash.h +60 -6
  36. data/vendor/libgit2/include/git2/strarray.h +0 -13
  37. data/vendor/libgit2/include/git2/sys/odb_backend.h +1 -1
  38. data/vendor/libgit2/include/git2/sys/transport.h +12 -0
  39. data/vendor/libgit2/include/git2/version.h +4 -4
  40. data/vendor/libgit2/include/git2.h +1 -0
  41. data/vendor/libgit2/src/CMakeLists.txt +0 -6
  42. data/vendor/libgit2/src/cli/CMakeLists.txt +6 -2
  43. data/vendor/libgit2/src/cli/cmd_hash_object.c +27 -8
  44. data/vendor/libgit2/src/cli/opt.c +1 -1
  45. data/vendor/libgit2/src/libgit2/CMakeLists.txt +25 -15
  46. data/vendor/libgit2/src/libgit2/annotated_commit.c +1 -1
  47. data/vendor/libgit2/src/libgit2/annotated_commit.h +1 -1
  48. data/vendor/libgit2/src/libgit2/attr_file.c +1 -1
  49. data/vendor/libgit2/src/libgit2/attrcache.c +1 -1
  50. data/vendor/libgit2/src/libgit2/blame.c +2 -0
  51. data/vendor/libgit2/src/libgit2/blob.c +4 -2
  52. data/vendor/libgit2/src/libgit2/blob.h +2 -2
  53. data/vendor/libgit2/src/libgit2/branch.c +2 -2
  54. data/vendor/libgit2/src/libgit2/cherrypick.c +3 -3
  55. data/vendor/libgit2/src/libgit2/clone.c +31 -2
  56. data/vendor/libgit2/src/libgit2/commit.c +52 -17
  57. data/vendor/libgit2/src/libgit2/commit.h +25 -7
  58. data/vendor/libgit2/src/libgit2/commit_graph.c +47 -32
  59. data/vendor/libgit2/src/libgit2/commit_graph.h +3 -0
  60. data/vendor/libgit2/src/libgit2/commit_list.c +6 -2
  61. data/vendor/libgit2/src/libgit2/config.c +1 -1
  62. data/vendor/libgit2/src/libgit2/config_file.c +2 -2
  63. data/vendor/libgit2/src/libgit2/describe.c +8 -8
  64. data/vendor/libgit2/src/libgit2/diff.c +5 -1
  65. data/vendor/libgit2/src/libgit2/diff_file.c +15 -6
  66. data/vendor/libgit2/src/libgit2/diff_generate.c +17 -12
  67. data/vendor/libgit2/src/libgit2/diff_print.c +5 -5
  68. data/vendor/libgit2/src/libgit2/diff_tform.c +4 -0
  69. data/vendor/libgit2/src/libgit2/email.c +2 -2
  70. data/vendor/libgit2/src/libgit2/experimental.h.in +13 -0
  71. data/vendor/libgit2/src/libgit2/fetch.c +3 -6
  72. data/vendor/libgit2/src/libgit2/fetchhead.c +4 -4
  73. data/vendor/libgit2/src/libgit2/ident.c +3 -3
  74. data/vendor/libgit2/src/libgit2/index.c +11 -9
  75. data/vendor/libgit2/src/libgit2/indexer.c +107 -44
  76. data/vendor/libgit2/src/libgit2/iterator.c +4 -2
  77. data/vendor/libgit2/src/libgit2/libgit2.c +19 -0
  78. data/vendor/libgit2/src/libgit2/merge.c +3 -3
  79. data/vendor/libgit2/src/libgit2/midx.c +16 -15
  80. data/vendor/libgit2/src/libgit2/mwindow.c +5 -2
  81. data/vendor/libgit2/src/libgit2/mwindow.h +4 -1
  82. data/vendor/libgit2/src/libgit2/notes.c +5 -5
  83. data/vendor/libgit2/src/libgit2/object.c +89 -25
  84. data/vendor/libgit2/src/libgit2/object.h +12 -3
  85. data/vendor/libgit2/src/libgit2/odb.c +194 -50
  86. data/vendor/libgit2/src/libgit2/odb.h +43 -4
  87. data/vendor/libgit2/src/libgit2/odb_loose.c +128 -70
  88. data/vendor/libgit2/src/libgit2/odb_pack.c +96 -44
  89. data/vendor/libgit2/src/libgit2/oid.c +134 -76
  90. data/vendor/libgit2/src/libgit2/oid.h +183 -9
  91. data/vendor/libgit2/src/libgit2/pack-objects.c +15 -4
  92. data/vendor/libgit2/src/libgit2/pack.c +90 -66
  93. data/vendor/libgit2/src/libgit2/pack.h +29 -15
  94. data/vendor/libgit2/src/libgit2/parse.c +4 -3
  95. data/vendor/libgit2/src/libgit2/patch_parse.c +5 -5
  96. data/vendor/libgit2/src/libgit2/push.c +13 -3
  97. data/vendor/libgit2/src/libgit2/reader.c +1 -1
  98. data/vendor/libgit2/src/libgit2/rebase.c +19 -18
  99. data/vendor/libgit2/src/libgit2/refdb_fs.c +70 -39
  100. data/vendor/libgit2/src/libgit2/reflog.c +7 -5
  101. data/vendor/libgit2/src/libgit2/reflog.h +1 -2
  102. data/vendor/libgit2/src/libgit2/refs.c +2 -0
  103. data/vendor/libgit2/src/libgit2/remote.c +38 -37
  104. data/vendor/libgit2/src/libgit2/remote.h +40 -0
  105. data/vendor/libgit2/src/libgit2/repository.c +212 -36
  106. data/vendor/libgit2/src/libgit2/repository.h +9 -0
  107. data/vendor/libgit2/src/libgit2/reset.c +2 -2
  108. data/vendor/libgit2/src/libgit2/revert.c +4 -4
  109. data/vendor/libgit2/src/libgit2/revparse.c +23 -7
  110. data/vendor/libgit2/src/libgit2/revwalk.c +5 -1
  111. data/vendor/libgit2/src/libgit2/stash.c +201 -26
  112. data/vendor/libgit2/src/libgit2/strarray.c +1 -0
  113. data/vendor/libgit2/src/libgit2/strarray.h +25 -0
  114. data/vendor/libgit2/src/libgit2/streams/openssl.c +1 -1
  115. data/vendor/libgit2/src/libgit2/streams/openssl_dynamic.c +7 -3
  116. data/vendor/libgit2/src/libgit2/streams/socket.c +4 -1
  117. data/vendor/libgit2/src/libgit2/submodule.c +6 -2
  118. data/vendor/libgit2/src/libgit2/sysdir.c +294 -7
  119. data/vendor/libgit2/src/libgit2/sysdir.h +39 -9
  120. data/vendor/libgit2/src/libgit2/tag.c +29 -10
  121. data/vendor/libgit2/src/libgit2/tag.h +2 -2
  122. data/vendor/libgit2/src/libgit2/threadstate.h +1 -1
  123. data/vendor/libgit2/src/libgit2/transports/http.c +8 -7
  124. data/vendor/libgit2/src/libgit2/transports/httpclient.c +9 -0
  125. data/vendor/libgit2/src/libgit2/transports/httpclient.h +10 -0
  126. data/vendor/libgit2/src/libgit2/transports/local.c +14 -0
  127. data/vendor/libgit2/src/libgit2/transports/smart.c +35 -0
  128. data/vendor/libgit2/src/libgit2/transports/smart.h +10 -1
  129. data/vendor/libgit2/src/libgit2/transports/smart_pkt.c +153 -41
  130. data/vendor/libgit2/src/libgit2/transports/smart_protocol.c +42 -12
  131. data/vendor/libgit2/src/libgit2/transports/ssh.c +62 -65
  132. data/vendor/libgit2/src/libgit2/transports/winhttp.c +9 -4
  133. data/vendor/libgit2/src/libgit2/tree-cache.c +4 -4
  134. data/vendor/libgit2/src/libgit2/tree.c +22 -16
  135. data/vendor/libgit2/src/libgit2/tree.h +2 -2
  136. data/vendor/libgit2/src/libgit2/worktree.c +5 -0
  137. data/vendor/libgit2/src/util/CMakeLists.txt +7 -1
  138. data/vendor/libgit2/src/util/fs_path.c +1 -1
  139. data/vendor/libgit2/src/util/futils.c +0 -3
  140. data/vendor/libgit2/src/util/git2_util.h +2 -2
  141. data/vendor/libgit2/src/util/hash/openssl.c +4 -3
  142. data/vendor/libgit2/src/util/hash/rfc6234/sha.h +0 -112
  143. data/vendor/libgit2/src/util/hash.h +13 -0
  144. data/vendor/libgit2/src/util/net.c +338 -84
  145. data/vendor/libgit2/src/util/net.h +7 -0
  146. data/vendor/libgit2/src/util/posix.h +2 -0
  147. data/vendor/libgit2/src/util/rand.c +4 -0
  148. data/vendor/libgit2/src/util/regexp.c +3 -3
  149. data/vendor/libgit2/src/util/thread.h +20 -19
  150. data/vendor/libgit2/src/util/util.h +1 -0
  151. metadata +7 -5
  152. data/vendor/libgit2/src/util/win32/findfile.c +0 -286
  153. data/vendor/libgit2/src/util/win32/findfile.h +0 -22
  154. /data/vendor/libgit2/src/{features.h.in → util/git2_features.h.in} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe3d6e73e95ee3f74eac9c4b36d2572a32f236af8e2003b00d2f0d36f5b90171
4
- data.tar.gz: 332f42def21e47d12cf171da17874747ed9fe2c8b5f4546bb4dce58909440758
3
+ metadata.gz: 352d7cd2514026a9539c7b3bca08450118cc29721d7ea969548aceb7a10a42f2
4
+ data.tar.gz: cba7b10bdc897406044a8205b8278fd6bd042e714df11fc868d663d9e6f39c73
5
5
  SHA512:
6
- metadata.gz: 7a319d0617aa24b8523b746d540626c54c687571a42ab86100715e472f7dadbbe0e9f00f1ced5534b24cbc6c9da0d42ad1c9142599b2ba7e7e253e5dfa8495ca
7
- data.tar.gz: ed27bc360a771d3f97012f85b1e8fd3d7b993c2f49fbb2766a6adbe8130531e8ba61e7f78f0b3a3ae90f2128d3b8db998850c4ac05c4389b096b9593bd9e6dec
6
+ metadata.gz: dfa9a28f28da9f52660f93ee665bcb0763cd5f1ada9a52fefaf2ea9582dd83f741c8bae512b0fd1337273055bab93dd1d6d0d0d096b7ff9412bc63c562a815fe
7
+ data.tar.gz: 348ee2757446376a08aeed8dec122867578963c22d7d491462552391d315cb5a92ff571ea9bb91e1dfacdea98558dc321d914e1030105885cecd936f624c8e04
@@ -71,12 +71,12 @@ if arg_config("--use-system-libraries", !!ENV['RUGGED_USE_SYSTEM_LIBRARIES'])
71
71
  major = minor = nil
72
72
 
73
73
  File.readlines(File.join(LIBGIT2_DIR, "include", "git2", "version.h")).each do |line|
74
- if !major && (matches = line.match(/^#define LIBGIT2_VER_MAJOR ([0-9]+)$/))
74
+ if !major && (matches = line.match(/^#define LIBGIT2_VER_MAJOR\s+([0-9]+)$/))
75
75
  major = matches[1]
76
76
  next
77
77
  end
78
78
 
79
- if !minor && (matches = line.match(/^#define LIBGIT2_VER_MINOR ([0-9]+)$/))
79
+ if !minor && (matches = line.match(/^#define LIBGIT2_VER_MINOR\s+([0-9]+)$/))
80
80
  minor = matches[1]
81
81
  next
82
82
  end
@@ -264,6 +264,8 @@ static VALUE rb_git_blame_each(VALUE self)
264
264
  void Init_rugged_blame(void)
265
265
  {
266
266
  rb_cRuggedBlame = rb_define_class_under(rb_mRugged, "Blame", rb_cObject);
267
+ rb_undef_alloc_func(rb_cRuggedBlame);
268
+
267
269
  rb_include_module(rb_cRuggedBlame, rb_mEnumerable);
268
270
 
269
271
  rb_define_singleton_method(rb_cRuggedBlame, "new", rb_git_blame_new, -1);
@@ -694,6 +694,7 @@ void Init_rugged_blob(void)
694
694
  id_read = rb_intern("read");
695
695
 
696
696
  rb_cRuggedBlob = rb_define_class_under(rb_mRugged, "Blob", rb_cRuggedObject);
697
+ rb_undef_alloc_func(rb_cRuggedBlob);
697
698
 
698
699
  rb_define_method(rb_cRuggedBlob, "size", rb_git_blob_rawsize, 0);
699
700
  rb_define_method(rb_cRuggedBlob, "content", rb_git_blob_content_GET, -1);
@@ -712,6 +713,8 @@ void Init_rugged_blob(void)
712
713
  rb_define_singleton_method(rb_cRuggedBlob, "merge_files", rb_git_blob_merge_files, -1);
713
714
 
714
715
  rb_cRuggedBlobSig = rb_define_class_under(rb_cRuggedBlob, "HashSignature", rb_cObject);
716
+ rb_undef_alloc_func(rb_cRuggedBlobSig);
717
+
715
718
  rb_define_singleton_method(rb_cRuggedBlobSig, "new", rb_git_blob_sig_new, -1);
716
719
  rb_define_singleton_method(rb_cRuggedBlobSig, "compare", rb_git_blob_sig_compare, 2);
717
720
  }
@@ -869,6 +869,7 @@ static VALUE rb_git_commit_create_with_signature(int argc, VALUE *argv, VALUE se
869
869
  void Init_rugged_commit(void)
870
870
  {
871
871
  rb_cRuggedCommit = rb_define_class_under(rb_mRugged, "Commit", rb_cRuggedObject);
872
+ rb_undef_alloc_func(rb_cRuggedCommit);
872
873
 
873
874
  rb_define_singleton_method(rb_cRuggedCommit, "create", rb_git_commit_create, 2);
874
875
  rb_define_singleton_method(rb_cRuggedCommit, "create_to_s", rb_git_commit_create_to_s, 2);
@@ -411,6 +411,8 @@ void Init_rugged_config(void)
411
411
  * Config
412
412
  */
413
413
  rb_cRuggedConfig = rb_define_class_under(rb_mRugged, "Config", rb_cObject);
414
+ rb_undef_alloc_func(rb_cRuggedConfig);
415
+
414
416
  rb_define_singleton_method(rb_cRuggedConfig, "new", rb_git_config_new, 1);
415
417
 
416
418
  rb_define_singleton_method(rb_cRuggedConfig, "global", rb_git_config_open_default, 0);
@@ -640,6 +640,7 @@ static VALUE rb_git_diff_sorted_icase_p(VALUE self)
640
640
  void Init_rugged_diff(void)
641
641
  {
642
642
  rb_cRuggedDiff = rb_define_class_under(rb_mRugged, "Diff", rb_cObject);
643
+ rb_undef_alloc_func(rb_cRuggedDiff);
643
644
 
644
645
  rb_define_method(rb_cRuggedDiff, "patch", rb_git_diff_patch, -1);
645
646
  rb_define_method(rb_cRuggedDiff, "write_patch", rb_git_diff_write_patch, -1);
@@ -1029,6 +1029,8 @@ void Init_rugged_index(void)
1029
1029
  * Index
1030
1030
  */
1031
1031
  rb_cRuggedIndex = rb_define_class_under(rb_mRugged, "Index", rb_cObject);
1032
+ rb_undef_alloc_func(rb_cRuggedIndex);
1033
+
1032
1034
  rb_define_singleton_method(rb_cRuggedIndex, "new", rb_git_index_new, -1);
1033
1035
 
1034
1036
  rb_define_method(rb_cRuggedIndex, "count", rb_git_index_count, 0);
@@ -383,6 +383,7 @@ static VALUE rb_git_diff_patch_header(VALUE self)
383
383
  void Init_rugged_patch(void)
384
384
  {
385
385
  rb_cRuggedPatch = rb_define_class_under(rb_mRugged, "Patch", rb_cObject);
386
+ rb_undef_alloc_func(rb_cRuggedPatch);
386
387
 
387
388
  rb_define_singleton_method(rb_cRuggedPatch, "from_strings", rb_git_patch_from_strings, -1);
388
389
 
@@ -389,6 +389,7 @@ static VALUE rebase_operation_type(git_rebase_operation *operation)
389
389
  void Init_rugged_rebase(void)
390
390
  {
391
391
  rb_cRuggedRebase = rb_define_class_under(rb_mRugged, "Rebase", rb_cObject);
392
+ rb_undef_alloc_func(rb_cRuggedRebase);
392
393
 
393
394
  rb_define_singleton_method(rb_cRuggedRebase, "new", rb_git_rebase_new, -1);
394
395
  rb_define_method(rb_cRuggedRebase, "next", rb_git_rebase_next, 0);
@@ -368,6 +368,7 @@ static VALUE rb_git_ref_is_tag(VALUE self)
368
368
  void Init_rugged_reference(void)
369
369
  {
370
370
  rb_cRuggedReference = rb_define_class_under(rb_mRugged, "Reference", rb_cObject);
371
+ rb_undef_alloc_func(rb_cRuggedReference);
371
372
 
372
373
  rb_define_singleton_method(rb_cRuggedReference, "valid_name?", rb_git_ref_valid_name, 1);
373
374
 
@@ -743,6 +743,7 @@ static VALUE rb_git_remote_push(int argc, VALUE *argv, VALUE self)
743
743
  void Init_rugged_remote(void)
744
744
  {
745
745
  rb_cRuggedRemote = rb_define_class_under(rb_mRugged, "Remote", rb_cObject);
746
+ rb_undef_alloc_func(rb_cRuggedRemote);
746
747
 
747
748
  rb_define_method(rb_cRuggedRemote, "name", rb_git_remote_name, 0);
748
749
  rb_define_method(rb_cRuggedRemote, "url", rb_git_remote_url, 0);
@@ -2738,7 +2738,7 @@ static VALUE rb_git_repo_cherrypick_commit(int argc, VALUE *argv, VALUE self)
2738
2738
 
2739
2739
  /*
2740
2740
  * call-seq: repo.diff_from_buffer(buffer) -> Rugged::Diff object
2741
- *
2741
+ *
2742
2742
  * Where +buffer+ is a +String+.
2743
2743
  * Returns A Rugged::Diff object
2744
2744
  */
@@ -2764,6 +2764,7 @@ void Init_rugged_repo(void)
2764
2764
  id_call = rb_intern("call");
2765
2765
 
2766
2766
  rb_cRuggedRepo = rb_define_class_under(rb_mRugged, "Repository", rb_cObject);
2767
+ rb_undef_alloc_func(rb_cRuggedRepo);
2767
2768
 
2768
2769
  rb_define_singleton_method(rb_cRuggedRepo, "new", rb_git_repo_new, -1);
2769
2770
  rb_define_singleton_method(rb_cRuggedRepo, "bare", rb_git_repo_open_bare, -1);
@@ -2817,7 +2818,7 @@ void Init_rugged_repo(void)
2817
2818
  rb_define_method(rb_cRuggedRepo, "apply", rb_git_repo_apply, -1);
2818
2819
 
2819
2820
  rb_define_method(rb_cRuggedRepo, "revert_commit", rb_git_repo_revert_commit, -1);
2820
-
2821
+
2821
2822
  rb_define_method(rb_cRuggedRepo, "diff_from_buffer", rb_git_diff_from_buffer, 1);
2822
2823
 
2823
2824
  rb_define_method(rb_cRuggedRepo, "path_ignored?", rb_git_repo_is_path_ignored, 1);
@@ -2841,6 +2842,8 @@ void Init_rugged_repo(void)
2841
2842
  rb_define_method(rb_cRuggedRepo, "fetch_attributes", rb_git_repo_attributes, -1);
2842
2843
 
2843
2844
  rb_cRuggedOdbObject = rb_define_class_under(rb_mRugged, "OdbObject", rb_cObject);
2845
+ rb_undef_alloc_func(rb_cRuggedOdbObject);
2846
+
2844
2847
  rb_define_method(rb_cRuggedOdbObject, "data", rb_git_odbobj_data, 0);
2845
2848
  rb_define_method(rb_cRuggedOdbObject, "len", rb_git_odbobj_size, 0);
2846
2849
  rb_define_method(rb_cRuggedOdbObject, "type", rb_git_odbobj_type, 0);
@@ -11,6 +11,8 @@ extern VALUE rb_mRugged;
11
11
  extern VALUE rb_cRuggedObject;
12
12
  VALUE rb_cRuggedWalker;
13
13
 
14
+ extern const rb_data_type_t rugged_object_type;
15
+
14
16
  static void rb_git_walk__free(git_revwalk *walk)
15
17
  {
16
18
  git_revwalk_free(walk);
@@ -43,7 +45,7 @@ static void push_commit_1(git_revwalk *walk, VALUE rb_commit, int hide)
43
45
  {
44
46
  if (rb_obj_is_kind_of(rb_commit, rb_cRuggedObject)) {
45
47
  git_object *object;
46
- Data_Get_Struct(rb_commit, git_object, object);
48
+ TypedData_Get_Struct(rb_commit, git_object, &rugged_object_type, object);
47
49
 
48
50
  push_commit_oid(walk, git_object_id(object), hide);
49
51
  return;
@@ -481,6 +483,8 @@ static VALUE rb_git_walker_each_oid(int argc, VALUE *argv, VALUE self)
481
483
  void Init_rugged_revwalk(void)
482
484
  {
483
485
  rb_cRuggedWalker = rb_define_class_under(rb_mRugged, "Walker", rb_cObject);
486
+ rb_undef_alloc_func(rb_cRuggedWalker);
487
+
484
488
  rb_define_singleton_method(rb_cRuggedWalker, "new", rb_git_walker_new, 1);
485
489
  rb_define_singleton_method(rb_cRuggedWalker, "walk", rb_git_walk, -1);
486
490
 
@@ -792,6 +792,7 @@ void Init_rugged_submodule(void)
792
792
  id_update_none = rb_intern("none");
793
793
 
794
794
  rb_cRuggedSubmodule = rb_define_class_under(rb_mRugged, "Submodule", rb_cObject);
795
+ rb_undef_alloc_func(rb_cRuggedSubmodule);
795
796
 
796
797
  rb_define_method(rb_cRuggedSubmodule, "finalize_add", rb_git_submodule_finalize_add, 0);
797
798
 
@@ -225,6 +225,7 @@ void Init_rugged_tag(void)
225
225
  rb_define_method(rb_cRuggedTag, "target", rb_git_tag_target, 0);
226
226
 
227
227
  rb_cRuggedTagAnnotation = rb_define_class_under(rb_cRuggedTag, "Annotation", rb_cRuggedObject);
228
+ rb_undef_alloc_func(rb_cRuggedTagAnnotation);
228
229
 
229
230
  rb_define_method(rb_cRuggedTagAnnotation, "message", rb_git_tag_annotation_message, 0);
230
231
  rb_define_method(rb_cRuggedTagAnnotation, "name", rb_git_tag_annotation_name, 0);
@@ -899,6 +899,8 @@ void Init_rugged_tree(void)
899
899
  * Tree
900
900
  */
901
901
  rb_cRuggedTree = rb_define_class_under(rb_mRugged, "Tree", rb_cRuggedObject);
902
+ rb_undef_alloc_func(rb_cRuggedTree);
903
+
902
904
  rb_define_method(rb_cRuggedTree, "count", rb_git_tree_entrycount, 0);
903
905
  rb_define_method(rb_cRuggedTree, "count_recursive", rb_git_tree_entrycount_recursive, -1);
904
906
  rb_define_method(rb_cRuggedTree, "length", rb_git_tree_entrycount, 0);
@@ -917,6 +919,8 @@ void Init_rugged_tree(void)
917
919
  rb_define_private_method(rb_singleton_class(rb_cRuggedTree), "diff_tree_to_tree", rb_git_diff_tree_to_tree, 4);
918
920
 
919
921
  rb_cRuggedTreeBuilder = rb_define_class_under(rb_cRuggedTree, "Builder", rb_cObject);
922
+ rb_undef_alloc_func(rb_cRuggedTreeBuilder);
923
+
920
924
  rb_define_singleton_method(rb_cRuggedTreeBuilder, "new", rb_git_treebuilder_new, -1);
921
925
  rb_define_method(rb_cRuggedTreeBuilder, "clear", rb_git_treebuilder_clear, 0);
922
926
  rb_define_method(rb_cRuggedTreeBuilder, "[]", rb_git_treebuilder_get, 1);
data/lib/rugged/index.rb CHANGED
@@ -81,7 +81,7 @@ module Rugged
81
81
  # :deltas_are_icase ::
82
82
  # If true, filename comparisons will be made with case-insensitivity.
83
83
  #
84
- # :include_untracked_content ::
84
+ # :show_untracked_content ::
85
85
  # if true, untracked content will be contained in the the diff patch text.
86
86
  #
87
87
  # :skip_binary_check ::
data/lib/rugged/tree.rb CHANGED
@@ -87,7 +87,7 @@ module Rugged
87
87
  # :deltas_are_icase ::
88
88
  # If true, filename comparisons will be made with case-insensitivity.
89
89
  #
90
- # :include_untracked_content ::
90
+ # :show_untracked_content ::
91
91
  # if true, untracked content will be contained in the the diff patch text.
92
92
  #
93
93
  # :skip_binary_check ::
@@ -4,5 +4,5 @@
4
4
  # For full terms see the included LICENSE file.
5
5
 
6
6
  module Rugged
7
- Version = VERSION = '1.5.1'
7
+ Version = VERSION = '1.6.2'
8
8
  end
@@ -6,7 +6,7 @@
6
6
 
7
7
  cmake_minimum_required(VERSION 3.5.1)
8
8
 
9
- project(libgit2 VERSION "1.5.1" LANGUAGES C)
9
+ project(libgit2 VERSION "1.6.2" LANGUAGES C)
10
10
 
11
11
  # Add find modules to the path
12
12
  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
@@ -15,6 +15,9 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
15
15
  # Build options
16
16
  #
17
17
 
18
+ # Experimental features
19
+ option(EXPERIMENTAL_SHA256 "Enable experimental SHA256 support (for R&D/testing)" OFF)
20
+
18
21
  # Optional subsystems
19
22
  option(BUILD_SHARED_LIBS "Build Shared Library (OFF for Static)" ON)
20
23
  option(BUILD_TESTS "Build Tests using the Clar suite" ON)
@@ -107,6 +110,7 @@ include(IdeSplitSources)
107
110
  include(FeatureSummary)
108
111
  include(EnableWarnings)
109
112
  include(DefaultCFlags)
113
+ include(ExperimentalFeatures)
110
114
 
111
115
 
112
116
  #
@@ -1184,3 +1184,33 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
1184
1184
  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
1185
1185
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1186
1186
 
1187
+ ----------------------------------------------------------------------
1188
+
1189
+ The built-in git_fs_path_basename_r() function is based on the
1190
+ Android implementation, BSD licensed:
1191
+
1192
+ Copyright (C) 2008 The Android Open Source Project
1193
+ All rights reserved.
1194
+
1195
+ Redistribution and use in source and binary forms, with or without
1196
+ modification, are permitted provided that the following conditions
1197
+ are met:
1198
+ * Redistributions of source code must retain the above copyright
1199
+ notice, this list of conditions and the following disclaimer.
1200
+ * Redistributions in binary form must reproduce the above copyright
1201
+ notice, this list of conditions and the following disclaimer in
1202
+ the documentation and/or other materials provided with the
1203
+ distribution.
1204
+
1205
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1206
+ AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1207
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
1208
+ FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
1209
+ COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
1210
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
1211
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
1212
+ OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
1213
+ AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
1214
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
1215
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1216
+ SUCH DAMAGE.
@@ -0,0 +1,23 @@
1
+ # Experimental feature support for libgit2 - developers can opt in to
2
+ # experimental functionality, like sha256 support. When experimental
3
+ # functionality is enabled, we set both a cmake flag *and* a compile
4
+ # definition. The cmake flag is used to generate `experimental.h`,
5
+ # which will be installed by a `make install`. But the compile definition
6
+ # is used by the libgit2 sources to detect the functionality at library
7
+ # build time. This allows us to have an in-tree `experimental.h` with
8
+ # *no* experiments enabled. This lets us support users who build without
9
+ # cmake and cannot generate the `experimental.h` file.
10
+
11
+ if(EXPERIMENTAL_SHA256)
12
+ add_feature_info("SHA256 API" ON "experimental SHA256 APIs")
13
+
14
+ set(EXPERIMENTAL 1)
15
+ set(GIT_EXPERIMENTAL_SHA256 1)
16
+ add_definitions(-DGIT_EXPERIMENTAL_SHA256=1)
17
+ else()
18
+ add_feature_info("SHA256 API" OFF "experimental SHA256 APIs")
19
+ endif()
20
+
21
+ if(EXPERIMENTAL)
22
+ set(LIBGIT2_FILENAME "${LIBGIT2_FILENAME}-experimental")
23
+ endif()
@@ -20,11 +20,13 @@ if(USE_HTTPS STREQUAL "SecureTransport")
20
20
  set_source_files_properties("crypt_commoncrypto.c" COMPILE_FLAGS "-Wno-deprecated")
21
21
  elseif(USE_HTTPS STREQUAL "OpenSSL")
22
22
  add_definitions(-DCRYPT_OPENSSL)
23
+ add_definitions(-DOPENSSL_API_COMPAT=0x10100000L)
23
24
  include_directories(${OPENSSL_INCLUDE_DIR})
24
25
  set(SRC_NTLMCLIENT_CRYPTO "crypt_openssl.c" "crypt_openssl.h")
25
26
  elseif(USE_HTTPS STREQUAL "OpenSSL-Dynamic")
26
27
  add_definitions(-DCRYPT_OPENSSL)
27
28
  add_definitions(-DCRYPT_OPENSSL_DYNAMIC)
29
+ add_definitions(-DOPENSSL_API_COMPAT=0x10100000L)
28
30
  set(SRC_NTLMCLIENT_CRYPTO "crypt_openssl.c" "crypt_openssl.h")
29
31
  elseif(USE_HTTPS STREQUAL "mbedTLS")
30
32
  add_definitions(-DCRYPT_MBEDTLS)
@@ -105,11 +105,6 @@ GIT_BEGIN_DECL
105
105
  */
106
106
  #define GIT_PATH_MAX 4096
107
107
 
108
- /**
109
- * The string representation of the null object ID.
110
- */
111
- #define GIT_OID_HEX_ZERO "0000000000000000000000000000000000000000"
112
-
113
108
  /**
114
109
  * Return the version of the libgit2 library
115
110
  * being currently used.
@@ -227,7 +222,9 @@ typedef enum {
227
222
  GIT_OPT_GET_EXTENSIONS,
228
223
  GIT_OPT_SET_EXTENSIONS,
229
224
  GIT_OPT_GET_OWNER_VALIDATION,
230
- GIT_OPT_SET_OWNER_VALIDATION
225
+ GIT_OPT_SET_OWNER_VALIDATION,
226
+ GIT_OPT_GET_HOMEDIR,
227
+ GIT_OPT_SET_HOMEDIR
231
228
  } git_libgit2_opt_t;
232
229
 
233
230
  /**
@@ -473,6 +470,16 @@ typedef enum {
473
470
  * > Set that repository directories should be owned by the current
474
471
  * > user. The default is to validate ownership.
475
472
  *
473
+ * opts(GIT_OPT_GET_HOMEDIR, git_buf *out)
474
+ * > Gets the current user's home directory, as it will be used
475
+ * > for file lookups. The path is written to the `out` buffer.
476
+ *
477
+ * opts(GIT_OPT_SET_HOMEDIR, const char *path)
478
+ * > Sets the directory used as the current user's home directory,
479
+ * > for file lookups.
480
+ * >
481
+ * > - `path` directory of home directory.
482
+ *
476
483
  * @param option Option key
477
484
  * @param ... value to set the option
478
485
  * @return 0 on success, <0 on failure
@@ -777,6 +777,12 @@ typedef git_trace_cb git_trace_callback;
777
777
  */
778
778
  /**@{*/
779
779
 
780
+ #ifndef GIT_EXPERIMENTAL_SHA256
781
+ # define GIT_OID_RAWSZ GIT_OID_SHA1_SIZE
782
+ # define GIT_OID_HEXSZ GIT_OID_SHA1_HEXSIZE
783
+ # define GIT_OID_HEX_ZERO GIT_OID_SHA1_HEXZERO
784
+ #endif
785
+
780
786
  GIT_EXTERN(int) git_oid_iszero(const git_oid *id);
781
787
 
782
788
  /**@}*/
@@ -274,7 +274,7 @@ typedef struct {
274
274
 
275
275
  /**
276
276
  * Represents the known length of the `id` field, when
277
- * converted to a hex string. It is generally `GIT_OID_HEXSZ`, unless this
277
+ * converted to a hex string. It is generally `GIT_OID_SHA1_HEXSIZE`, unless this
278
278
  * delta was created from reading a patch file, in which case it may be
279
279
  * abbreviated to something reasonable, like 7 characters.
280
280
  */
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Copyright (C) the libgit2 contributors. All rights reserved.
3
+ *
4
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
5
+ * a Linking Exception. For full terms see the included COPYING file.
6
+ */
7
+
8
+ #ifndef INCLUDE_experimental_h__
9
+ #define INCLUDE_experimental_h__
10
+
11
+ /*
12
+ * This file exists to support users who build libgit2 with a bespoke
13
+ * build system and do not use our cmake configuration. Normally, cmake
14
+ * will create `experimental.h` from the `experimental.h.in` file and
15
+ * will include the generated file instead of this one. For non-cmake
16
+ * users, we bundle this `experimental.h` file which will be used
17
+ * instead.
18
+ */
19
+
20
+ #endif
@@ -62,6 +62,19 @@ typedef int GIT_CALLBACK(git_indexer_progress_cb)(const git_indexer_progress *st
62
62
  typedef struct git_indexer_options {
63
63
  unsigned int version;
64
64
 
65
+ #ifdef GIT_EXPERIMENTAL_SHA256
66
+ /** permissions to use creating packfile or 0 for defaults */
67
+ unsigned int mode;
68
+
69
+ /**
70
+ * object database from which to read base objects when
71
+ * fixing thin packs. This can be NULL if there are no thin
72
+ * packs; if a thin pack is encountered, an error will be
73
+ * returned if there are bases missing.
74
+ */
75
+ git_odb *odb;
76
+ #endif
77
+
65
78
  /** progress_cb function to call with progress information */
66
79
  git_indexer_progress_cb progress_cb;
67
80
 
@@ -87,6 +100,21 @@ GIT_EXTERN(int) git_indexer_options_init(
87
100
  git_indexer_options *opts,
88
101
  unsigned int version);
89
102
 
103
+ #ifdef GIT_EXPERIMENTAL_SHA256
104
+ /**
105
+ * Create a new indexer instance
106
+ *
107
+ * @param out where to store the indexer instance
108
+ * @param path to the directory where the packfile should be stored
109
+ * @param oid_type the oid type to use for objects
110
+ * @return 0 or an error code.
111
+ */
112
+ GIT_EXTERN(int) git_indexer_new(
113
+ git_indexer **out,
114
+ const char *path,
115
+ git_oid_t oid_type,
116
+ git_indexer_options *opts);
117
+ #else
90
118
  /**
91
119
  * Create a new indexer instance
92
120
  *
@@ -106,6 +134,7 @@ GIT_EXTERN(int) git_indexer_new(
106
134
  unsigned int mode,
107
135
  git_odb *odb,
108
136
  git_indexer_options *opts);
137
+ #endif
109
138
 
110
139
  /**
111
140
  * Add data to the indexer
@@ -225,6 +225,7 @@ GIT_EXTERN(int) git_object_peel(
225
225
  */
226
226
  GIT_EXTERN(int) git_object_dup(git_object **dest, git_object *source);
227
227
 
228
+ #ifdef GIT_EXPERIMENTAL_SHA256
228
229
  /**
229
230
  * Analyzes a buffer of raw object content and determines its validity.
230
231
  * Tree, commit, and tag objects will be parsed and ensured that they
@@ -238,14 +239,39 @@ GIT_EXTERN(int) git_object_dup(git_object **dest, git_object *source);
238
239
  * @param valid Output pointer to set with validity of the object content
239
240
  * @param buf The contents to validate
240
241
  * @param len The length of the buffer
241
- * @param type The type of the object in the buffer
242
+ * @param object_type The type of the object in the buffer
243
+ * @param oid_type The object ID type for the OIDs in the given buffer
242
244
  * @return 0 on success or an error code
243
245
  */
244
246
  GIT_EXTERN(int) git_object_rawcontent_is_valid(
245
247
  int *valid,
246
248
  const char *buf,
247
249
  size_t len,
248
- git_object_t type);
250
+ git_object_t object_type,
251
+ git_oid_t oid_type);
252
+ #else
253
+ /**
254
+ * Analyzes a buffer of raw object content and determines its validity.
255
+ * Tree, commit, and tag objects will be parsed and ensured that they
256
+ * are valid, parseable content. (Blobs are always valid by definition.)
257
+ * An error message will be set with an informative message if the object
258
+ * is not valid.
259
+ *
260
+ * @warning This function is experimental and its signature may change in
261
+ * the future.
262
+ *
263
+ * @param valid Output pointer to set with validity of the object content
264
+ * @param buf The contents to validate
265
+ * @param len The length of the buffer
266
+ * @param object_type The type of the object in the buffer
267
+ * @return 0 on success or an error code
268
+ */
269
+ GIT_EXTERN(int) git_object_rawcontent_is_valid(
270
+ int *valid,
271
+ const char *buf,
272
+ size_t len,
273
+ git_object_t object_type);
274
+ #endif
249
275
 
250
276
  /** @} */
251
277
  GIT_END_DECL