rugged 0.25.0b10 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rugged/extconf.rb +5 -0
  3. data/ext/rugged/rugged.c +3 -20
  4. data/ext/rugged/rugged.h +3 -20
  5. data/ext/rugged/rugged_backend.c +3 -20
  6. data/ext/rugged/rugged_blame.c +7 -24
  7. data/ext/rugged/rugged_blob.c +5 -22
  8. data/ext/rugged/rugged_branch.c +3 -20
  9. data/ext/rugged/rugged_branch_collection.c +3 -20
  10. data/ext/rugged/rugged_commit.c +37 -24
  11. data/ext/rugged/rugged_config.c +3 -20
  12. data/ext/rugged/rugged_cred.c +3 -20
  13. data/ext/rugged/rugged_diff.c +3 -20
  14. data/ext/rugged/rugged_diff_delta.c +3 -20
  15. data/ext/rugged/rugged_diff_hunk.c +3 -20
  16. data/ext/rugged/rugged_diff_line.c +3 -20
  17. data/ext/rugged/rugged_index.c +38 -149
  18. data/ext/rugged/rugged_note.c +3 -20
  19. data/ext/rugged/rugged_object.c +3 -20
  20. data/ext/rugged/rugged_patch.c +4 -22
  21. data/ext/rugged/rugged_rebase.c +3 -20
  22. data/ext/rugged/rugged_reference.c +4 -21
  23. data/ext/rugged/rugged_reference_collection.c +3 -20
  24. data/ext/rugged/rugged_remote.c +4 -21
  25. data/ext/rugged/rugged_remote_collection.c +3 -20
  26. data/ext/rugged/rugged_repo.c +5 -22
  27. data/ext/rugged/rugged_revwalk.c +4 -21
  28. data/ext/rugged/rugged_settings.c +3 -20
  29. data/ext/rugged/rugged_signature.c +3 -20
  30. data/ext/rugged/rugged_submodule.c +4 -21
  31. data/ext/rugged/rugged_submodule_collection.c +3 -20
  32. data/ext/rugged/rugged_tag.c +3 -20
  33. data/ext/rugged/rugged_tag_collection.c +3 -20
  34. data/ext/rugged/rugged_tree.c +56 -183
  35. data/lib/rugged.rb +5 -0
  36. data/lib/rugged/attributes.rb +5 -0
  37. data/lib/rugged/blob.rb +5 -0
  38. data/lib/rugged/branch.rb +6 -1
  39. data/lib/rugged/commit.rb +5 -0
  40. data/lib/rugged/console.rb +5 -0
  41. data/lib/rugged/credentials.rb +5 -0
  42. data/lib/rugged/diff.rb +5 -0
  43. data/lib/rugged/diff/delta.rb +5 -0
  44. data/lib/rugged/diff/hunk.rb +5 -0
  45. data/lib/rugged/diff/line.rb +5 -0
  46. data/lib/rugged/index.rb +120 -0
  47. data/lib/rugged/object.rb +5 -0
  48. data/lib/rugged/patch.rb +5 -0
  49. data/lib/rugged/reference.rb +5 -0
  50. data/lib/rugged/remote.rb +5 -0
  51. data/lib/rugged/repository.rb +6 -1
  52. data/lib/rugged/submodule_collection.rb +5 -0
  53. data/lib/rugged/tag.rb +5 -0
  54. data/lib/rugged/tree.rb +156 -1
  55. data/lib/rugged/version.rb +6 -1
  56. data/lib/rugged/walker.rb +5 -0
  57. data/vendor/libgit2/include/git2/common.h +20 -1
  58. data/vendor/libgit2/include/git2/describe.h +5 -2
  59. data/vendor/libgit2/include/git2/patch.h +1 -1
  60. data/vendor/libgit2/include/git2/proxy.h +1 -1
  61. data/vendor/libgit2/include/git2/remote.h +4 -4
  62. data/vendor/libgit2/include/git2/transaction.h +9 -0
  63. data/vendor/libgit2/include/git2/version.h +3 -3
  64. data/vendor/libgit2/src/apply.c +1 -1
  65. data/vendor/libgit2/src/branch.c +5 -4
  66. data/vendor/libgit2/src/checkout.c +2 -2
  67. data/vendor/libgit2/src/commit.c +4 -3
  68. data/vendor/libgit2/src/common.h +2 -1
  69. data/vendor/libgit2/src/curl_stream.c +19 -2
  70. data/vendor/libgit2/src/diff_stats.c +18 -10
  71. data/vendor/libgit2/src/fetchhead.c +8 -8
  72. data/vendor/libgit2/src/fileops.c +9 -1
  73. data/vendor/libgit2/src/fileops.h +2 -2
  74. data/vendor/libgit2/src/global.c +19 -4
  75. data/vendor/libgit2/src/global.h +6 -0
  76. data/vendor/libgit2/src/graph.c +1 -1
  77. data/vendor/libgit2/src/index.c +1 -1
  78. data/vendor/libgit2/src/iterator.c +1 -1
  79. data/vendor/libgit2/src/merge.c +1 -1
  80. data/vendor/libgit2/src/odb.c +1 -1
  81. data/vendor/libgit2/src/odb_mempack.c +1 -1
  82. data/vendor/libgit2/src/openssl_stream.c +45 -26
  83. data/vendor/libgit2/src/openssl_stream.h +106 -0
  84. data/vendor/libgit2/src/pack.c +12 -7
  85. data/vendor/libgit2/src/patch_generate.c +1 -1
  86. data/vendor/libgit2/src/patch_parse.c +28 -26
  87. data/vendor/libgit2/src/path.c +5 -2
  88. data/vendor/libgit2/src/pqueue.c +3 -2
  89. data/vendor/libgit2/src/rebase.c +1 -1
  90. data/vendor/libgit2/src/refdb.c +4 -2
  91. data/vendor/libgit2/src/refdb_fs.c +82 -54
  92. data/vendor/libgit2/src/repository.c +9 -6
  93. data/vendor/libgit2/src/revwalk.c +1 -1
  94. data/vendor/libgit2/src/settings.c +2 -0
  95. data/vendor/libgit2/src/signature.c +1 -1
  96. data/vendor/libgit2/src/sortedcache.c +14 -5
  97. data/vendor/libgit2/src/sysdir.c +1 -1
  98. data/vendor/libgit2/src/transports/http.c +1 -1
  99. data/vendor/libgit2/src/transports/smart_protocol.c +11 -7
  100. data/vendor/libgit2/src/tree.c +13 -5
  101. data/vendor/libgit2/src/unix/pthread.h +2 -0
  102. data/vendor/libgit2/src/win32/thread.c +18 -0
  103. data/vendor/libgit2/src/win32/thread.h +2 -0
  104. data/vendor/libgit2/src/win32/w32_util.h +1 -1
  105. data/vendor/libgit2/src/zstream.c +1 -1
  106. metadata +76 -76
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 97986b6a7f5c847a110b691dbeb47de7e7d874b4
4
- data.tar.gz: 9c327457493ea0b9b92893fa2f755214bdde6118
3
+ metadata.gz: e7c6702ff8d1ff0c9c82ed452dc97b5f070f0bfa
4
+ data.tar.gz: a8e2f585ba932121e5e26ea29bfe7fe0b60a8d9a
5
5
  SHA512:
6
- metadata.gz: 5b18c64924beb9a8ce939b513d87ea3878c8cff5bf6f1908f4baf86b3aed57cb5416e5609e2f6c7c837ccffc20666433799e01363ef46c20b6edd8ec0de7283d
7
- data.tar.gz: 036fdab8629da7429516183c8c2aa2c99d724dc58b747230012cb9d02e8f7be345904fd319dfc053f40d4ac87e8ed045cd6c6139a3f4dd62ca5dc282b1b14ff5
6
+ metadata.gz: 8f5079be650d4c3af4f7cf786e531a114f272bf777bc7f3c71dec98955bbcadb85676d4b96384eef2ded67666f80dc0957f628e5565f4657ca5d288ba0d5c8dd
7
+ data.tar.gz: b88543357bc283cd08a8214e56e4bd6f3172293e46e2ddcab93aca4bf2197e7187c08e0ed6a3e7924b82504605622563f6de3c2a71a6ee7d7ff832a5f7f9165c
@@ -1,3 +1,8 @@
1
+ # Copyright (C) the Rugged contributors. All rights reserved.
2
+ #
3
+ # This file is part of Rugged, distributed under the MIT license.
4
+ # For full terms see the included LICENSE file.
5
+
1
6
  require 'mkmf'
2
7
 
3
8
  RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
@@ -1,25 +1,8 @@
1
1
  /*
2
- * The MIT License
2
+ * Copyright (C) the Rugged contributors. All rights reserved.
3
3
  *
4
- * Copyright (c) 2014 GitHub, Inc
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in
14
- * all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- * THE SOFTWARE.
4
+ * This file is part of Rugged, distributed under the MIT license.
5
+ * For full terms see the included LICENSE file.
23
6
  */
24
7
 
25
8
  #include "rugged.h"
@@ -1,25 +1,8 @@
1
1
  /*
2
- * The MIT License
2
+ * Copyright (C) the Rugged contributors. All rights reserved.
3
3
  *
4
- * Copyright (c) 2014 GitHub, Inc
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in
14
- * all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- * THE SOFTWARE.
4
+ * This file is part of Rugged, distributed under the MIT license.
5
+ * For full terms see the included LICENSE file.
23
6
  */
24
7
 
25
8
  #ifndef __H_RUGGED_BINDINGS__
@@ -1,25 +1,8 @@
1
1
  /*
2
- * The MIT License
2
+ * Copyright (C) the Rugged contributors. All rights reserved.
3
3
  *
4
- * Copyright (c) 2014 GitHub, Inc
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in
14
- * all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- * THE SOFTWARE.
4
+ * This file is part of Rugged, distributed under the MIT license.
5
+ * For full terms see the included LICENSE file.
23
6
  */
24
7
 
25
8
  #include "rugged.h"
@@ -1,25 +1,8 @@
1
1
  /*
2
- * The MIT License
2
+ * Copyright (C) the Rugged contributors. All rights reserved.
3
3
  *
4
- * Copyright (c) 2014 GitHub, Inc
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in
14
- * all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- * THE SOFTWARE.
4
+ * This file is part of Rugged, distributed under the MIT license.
5
+ * For full terms see the included LICENSE file.
23
6
  */
24
7
 
25
8
  #include "rugged.h"
@@ -125,19 +108,19 @@ static void rugged_parse_blame_options(git_blame_options *opts, git_repository *
125
108
  * The last line in the file to blame. Defaults to the last line in
126
109
  * the file.
127
110
  *
128
- * :track_copies_same_file
111
+ * :track_copies_same_file ::
129
112
  * If this value is +true+, lines that have moved within a file will be
130
113
  * tracked (like `git blame -M`).
131
114
  *
132
- * :track_copies_same_commit_moves
115
+ * :track_copies_same_commit_moves ::
133
116
  * If this value is +true+, lines that have moved across files in the same
134
117
  * commit will be tracked (like `git blame -C`).
135
118
  *
136
- * :track_copies_same_commit_copies
119
+ * :track_copies_same_commit_copies ::
137
120
  * If this value is +true+, lines that have been copied from another file
138
121
  * that exists in the same commit will be tracked (like `git blame -CC`).
139
122
  *
140
- * :track_copies_any_commit_copies
123
+ * :track_copies_any_commit_copies ::
141
124
  * If this value is +true+, lines that have been copied from another file
142
125
  * that exists in *any* commit will be tracked (like `git blame -CCC`).
143
126
  *
@@ -1,25 +1,8 @@
1
1
  /*
2
- * The MIT License
3
- *
4
- * Copyright (c) 2014 GitHub, Inc
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in
14
- * all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- * THE SOFTWARE.
2
+ * Copyright (C) the Rugged contributors. All rights reserved.
3
+ *
4
+ * This file is part of Rugged, distributed under the MIT license.
5
+ * For full terms see the included LICENSE file.
23
6
  */
24
7
 
25
8
  #include "rugged.h"
@@ -607,7 +590,7 @@ static int rugged_load_merge_file_input(git_blob **out, git_repository *repo, ru
607
590
 
608
591
  static VALUE rb_git_blob_merge_files(int argc, VALUE *argv, VALUE klass)
609
592
  {
610
- VALUE rb_repo, rb_ancestor, rb_ours, rb_theirs, rb_options, rb_result;
593
+ VALUE rb_repo, rb_ancestor, rb_ours, rb_theirs, rb_options, rb_result = Qnil;
611
594
 
612
595
  git_repository *repo = NULL;
613
596
  rugged_merge_file_input ancestor = RUGGED_MERGE_FILE_INPUT_INIT,
@@ -1,25 +1,8 @@
1
1
  /*
2
- * The MIT License
2
+ * Copyright (C) the Rugged contributors. All rights reserved.
3
3
  *
4
- * Copyright (c) 2014 GitHub, Inc
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in
14
- * all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- * THE SOFTWARE.
4
+ * This file is part of Rugged, distributed under the MIT license.
5
+ * For full terms see the included LICENSE file.
23
6
  */
24
7
 
25
8
  #include "rugged.h"
@@ -1,25 +1,8 @@
1
1
  /*
2
- * The MIT License
2
+ * Copyright (C) the Rugged contributors. All rights reserved.
3
3
  *
4
- * Copyright (c) 2014 GitHub, Inc
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in
14
- * all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- * THE SOFTWARE.
4
+ * This file is part of Rugged, distributed under the MIT license.
5
+ * For full terms see the included LICENSE file.
23
6
  */
24
7
 
25
8
  #include "rugged.h"
@@ -1,25 +1,8 @@
1
1
  /*
2
- * The MIT License
3
- *
4
- * Copyright (c) 2014 GitHub, Inc
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in
14
- * all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- * THE SOFTWARE.
2
+ * Copyright (C) the Rugged contributors. All rights reserved.
3
+ *
4
+ * This file is part of Rugged, distributed under the MIT license.
5
+ * For full terms see the included LICENSE file.
23
6
  */
24
7
 
25
8
  #include "rugged.h"
@@ -36,7 +19,7 @@ VALUE rb_cRuggedCommit;
36
19
  * commit.message -> msg
37
20
  *
38
21
  * Return the message of this commit. This includes the full body of the
39
- * message, with the short description, detailed descritpion, and any
22
+ * message, with the short description, detailed description, and any
40
23
  * optional footers or signatures after it.
41
24
  *
42
25
  * In Ruby 1.9+, the returned string will be encoded with the encoding
@@ -61,6 +44,35 @@ static VALUE rb_git_commit_message_GET(VALUE self)
61
44
  return rb_enc_str_new(message, strlen(message), encoding);
62
45
  }
63
46
 
47
+ /*
48
+ * call-seq:
49
+ * commit.summary -> summary
50
+ *
51
+ * Return the short summary message of this commit.
52
+ *
53
+ * In Ruby 1.9+, the returned string will be encoded with the encoding
54
+ * specified in the +Encoding+ header of the commit, if available.
55
+ *
56
+ * commit.message #=> "add a lot of RDoc docs\n\nthis includes docs for commit and blob"
57
+ * commit.summary #=> "add a lot of RDoc docs"
58
+ */
59
+ static VALUE rb_git_commit_summary_GET(VALUE self)
60
+ {
61
+ git_commit *commit;
62
+ rb_encoding *encoding = rb_utf8_encoding();
63
+ const char *encoding_name;
64
+ const char *summary;
65
+
66
+ Data_Get_Struct(self, git_commit, commit);
67
+
68
+ summary = git_commit_summary(commit);
69
+ encoding_name = git_commit_message_encoding(commit);
70
+ if (encoding_name != NULL)
71
+ encoding = rb_enc_find(encoding_name);
72
+
73
+ return rb_enc_str_new(summary, strlen(summary), encoding);
74
+ }
75
+
64
76
  /*
65
77
  * call-seq:
66
78
  * commit.committer -> signature
@@ -645,7 +657,7 @@ static VALUE rb_git_commit_header(VALUE self)
645
657
 
646
658
  /*
647
659
  * call-seq:
648
- * Rugged::Commit.extract_signature(repo, commit, field_name) -> [str, str]
660
+ * Commit.extract_signature(repo, commit, field_name) -> [str, str]
649
661
  *
650
662
  * Returns +commit+'s signature in 'field' and the signed data
651
663
  *
@@ -761,7 +773,7 @@ cleanup:
761
773
 
762
774
  /*
763
775
  * call-seq:
764
- * Rugged::Commit.create_with_signature(repo, content, signature, field_name = "gpgsig") -> oid
776
+ * Commit.create_with_signature(repo, content, signature, field_name = "gpgsig") -> oid
765
777
  *
766
778
  * Create a commit from the +content+ string and the +signature+,
767
779
  * adding this data to the +field_name+ header field in the resulting
@@ -807,6 +819,7 @@ void Init_rugged_commit(void)
807
819
  rb_define_singleton_method(rb_cRuggedCommit, "extract_signature", rb_git_commit_extract_signature, -1);
808
820
 
809
821
  rb_define_method(rb_cRuggedCommit, "message", rb_git_commit_message_GET, 0);
822
+ rb_define_method(rb_cRuggedCommit, "summary", rb_git_commit_summary_GET, 0);
810
823
  rb_define_method(rb_cRuggedCommit, "epoch_time", rb_git_commit_epoch_time_GET, 0);
811
824
  rb_define_method(rb_cRuggedCommit, "committer", rb_git_commit_committer_GET, 0);
812
825
  rb_define_method(rb_cRuggedCommit, "author", rb_git_commit_author_GET, 0);
@@ -1,25 +1,8 @@
1
1
  /*
2
- * The MIT License
2
+ * Copyright (C) the Rugged contributors. All rights reserved.
3
3
  *
4
- * Copyright (c) 2014 GitHub, Inc
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in
14
- * all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- * THE SOFTWARE.
4
+ * This file is part of Rugged, distributed under the MIT license.
5
+ * For full terms see the included LICENSE file.
23
6
  */
24
7
 
25
8
  #include "rugged.h"
@@ -1,25 +1,8 @@
1
1
  /*
2
- * The MIT License
2
+ * Copyright (C) the Rugged contributors. All rights reserved.
3
3
  *
4
- * Copyright (c) 2014 GitHub, Inc
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in
14
- * all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- * THE SOFTWARE.
4
+ * This file is part of Rugged, distributed under the MIT license.
5
+ * For full terms see the included LICENSE file.
23
6
  */
24
7
 
25
8
  #include "rugged.h"
@@ -1,25 +1,8 @@
1
1
  /*
2
- * The MIT License
2
+ * Copyright (C) the Rugged contributors. All rights reserved.
3
3
  *
4
- * Copyright (c) 2014 GitHub, Inc
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in
14
- * all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- * THE SOFTWARE.
4
+ * This file is part of Rugged, distributed under the MIT license.
5
+ * For full terms see the included LICENSE file.
23
6
  */
24
7
 
25
8
  #include "rugged.h"