@@ -15,6 +15,8 @@ extern VALUE rb_cRuggedRepo;
15
15
extern VALUE rb_cRuggedSignature ;
16
16
VALUE rb_cRuggedCommit ;
17
17
18
+ extern const rb_data_type_t rugged_object_type ;
19
+
18
20
/*
19
21
* call-seq:
20
22
* commit.message -> msg
@@ -35,7 +37,7 @@ static VALUE rb_git_commit_message_GET(VALUE self)
35
37
const char * encoding_name ;
36
38
const char * message ;
37
39
38
- Data_Get_Struct (self , git_commit , commit );
40
+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
39
41
40
42
message = git_commit_message (commit );
41
43
encoding_name = git_commit_message_encoding (commit );
@@ -68,7 +70,7 @@ static VALUE rb_git_commit_trailers_GET(VALUE self)
68
70
int error ;
69
71
size_t i ;
70
72
71
- Data_Get_Struct (self , git_commit , commit );
73
+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
72
74
73
75
encoding_name = git_commit_message_encoding (commit );
74
76
if (encoding_name != NULL )
@@ -118,7 +120,7 @@ static VALUE rb_git_commit_summary_GET(VALUE self)
118
120
const char * encoding_name ;
119
121
const char * summary ;
120
122
121
- Data_Get_Struct (self , git_commit , commit );
123
+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
122
124
123
125
summary = git_commit_summary (commit );
124
126
encoding_name = git_commit_message_encoding (commit );
@@ -147,7 +149,7 @@ static VALUE rb_git_commit_summary_GET(VALUE self)
147
149
static VALUE rb_git_commit_committer_GET (VALUE self )
148
150
{
149
151
git_commit * commit ;
150
- Data_Get_Struct (self , git_commit , commit );
152
+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
151
153
152
154
return rugged_signature_new (
153
155
git_commit_committer (commit ),
@@ -172,7 +174,7 @@ static VALUE rb_git_commit_committer_GET(VALUE self)
172
174
static VALUE rb_git_commit_author_GET (VALUE self )
173
175
{
174
176
git_commit * commit ;
175
- Data_Get_Struct (self , git_commit , commit );
177
+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
176
178
177
179
return rugged_signature_new (
178
180
git_commit_author (commit ),
@@ -192,7 +194,7 @@ static VALUE rb_git_commit_author_GET(VALUE self)
192
194
static VALUE rb_git_commit_epoch_time_GET (VALUE self )
193
195
{
194
196
git_commit * commit ;
195
- Data_Get_Struct (self , git_commit , commit );
197
+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
196
198
197
199
return ULONG2NUM (git_commit_time (commit ));
198
200
}
@@ -213,7 +215,7 @@ static VALUE rb_git_commit_tree_GET(VALUE self)
213
215
VALUE owner ;
214
216
int error ;
215
217
216
- Data_Get_Struct (self , git_commit , commit );
218
+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
217
219
owner = rugged_owner (self );
218
220
219
221
error = git_commit_tree (& tree , commit );
@@ -236,7 +238,7 @@ static VALUE rb_git_commit_tree_id_GET(VALUE self)
236
238
git_commit * commit ;
237
239
const git_oid * tree_id ;
238
240
239
- Data_Get_Struct (self , git_commit , commit );
241
+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
240
242
241
243
tree_id = git_commit_tree_id (commit );
242
244
@@ -262,7 +264,7 @@ static VALUE rb_git_commit_parents_GET(VALUE self)
262
264
VALUE ret_arr , owner ;
263
265
int error ;
264
266
265
- Data_Get_Struct (self , git_commit , commit );
267
+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
266
268
owner = rugged_owner (self );
267
269
268
270
parent_count = git_commit_parentcount (commit );
@@ -295,7 +297,7 @@ static VALUE rb_git_commit_parent_ids_GET(VALUE self)
295
297
unsigned int n , parent_count ;
296
298
VALUE ret_arr ;
297
299
298
- Data_Get_Struct (self , git_commit , commit );
300
+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
299
301
300
302
parent_count = git_commit_parentcount (commit );
301
303
ret_arr = rb_ary_new2 ((long )parent_count );
@@ -352,7 +354,7 @@ static VALUE rb_git_commit_amend(VALUE self, VALUE rb_data)
352
354
353
355
Check_Type (rb_data , T_HASH );
354
356
355
- Data_Get_Struct (self , git_commit , commit_to_amend );
357
+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit_to_amend );
356
358
357
359
owner = rugged_owner (self );
358
360
Data_Get_Struct (owner , git_repository , repo );
@@ -474,7 +476,7 @@ static VALUE parse_commit_options(struct commit_data *out, git_repository *repo,
474
476
if (error < GIT_OK )
475
477
goto out ;
476
478
} else if (rb_obj_is_kind_of (p , rb_cRuggedCommit )) {
477
- Data_Get_Struct (p , git_commit , tmp );
479
+ TypedData_Get_Struct (p , git_commit , & rugged_object_type , tmp );
478
480
if ((error = git_object_dup ((git_object * * ) & parent , (git_object * ) tmp )) < 0 )
479
481
goto out ;
480
482
} else {
@@ -614,7 +616,7 @@ static VALUE rb_git_commit_to_mbox(int argc, VALUE *argv, VALUE self)
614
616
rugged_check_repo (rb_repo );
615
617
Data_Get_Struct (rb_repo , git_repository , repo );
616
618
617
- Data_Get_Struct (self , git_commit , commit );
619
+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
618
620
619
621
if (!NIL_P (rb_options )) {
620
622
Check_Type (rb_options , T_HASH );
@@ -673,7 +675,7 @@ static VALUE rb_git_commit_header_field(VALUE self, VALUE rb_field)
673
675
int error ;
674
676
675
677
Check_Type (rb_field , T_STRING );
676
- Data_Get_Struct (self , git_commit , commit );
678
+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
677
679
678
680
error = git_commit_header_field (& header_field , commit , StringValueCStr (rb_field ));
679
681
@@ -704,7 +706,7 @@ static VALUE rb_git_commit_header(VALUE self)
704
706
git_commit * commit ;
705
707
const char * raw_header ;
706
708
707
- Data_Get_Struct (self , git_commit , commit );
709
+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
708
710
709
711
raw_header = git_commit_raw_header (commit );
710
712
return rb_str_new_utf8 (raw_header );
0 commit comments