@@ -15,6 +15,8 @@ extern VALUE rb_cRuggedRepo;
1515extern VALUE rb_cRuggedSignature ;
1616VALUE rb_cRuggedCommit ;
1717
18+ extern const rb_data_type_t rugged_object_type ;
19+
1820/*
1921 * call-seq:
2022 * commit.message -> msg
@@ -35,7 +37,7 @@ static VALUE rb_git_commit_message_GET(VALUE self)
3537 const char * encoding_name ;
3638 const char * message ;
3739
38- Data_Get_Struct (self , git_commit , commit );
40+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
3941
4042 message = git_commit_message (commit );
4143 encoding_name = git_commit_message_encoding (commit );
@@ -68,7 +70,7 @@ static VALUE rb_git_commit_trailers_GET(VALUE self)
6870 int error ;
6971 size_t i ;
7072
71- Data_Get_Struct (self , git_commit , commit );
73+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
7274
7375 encoding_name = git_commit_message_encoding (commit );
7476 if (encoding_name != NULL )
@@ -118,7 +120,7 @@ static VALUE rb_git_commit_summary_GET(VALUE self)
118120 const char * encoding_name ;
119121 const char * summary ;
120122
121- Data_Get_Struct (self , git_commit , commit );
123+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
122124
123125 summary = git_commit_summary (commit );
124126 encoding_name = git_commit_message_encoding (commit );
@@ -147,7 +149,7 @@ static VALUE rb_git_commit_summary_GET(VALUE self)
147149static VALUE rb_git_commit_committer_GET (VALUE self )
148150{
149151 git_commit * commit ;
150- Data_Get_Struct (self , git_commit , commit );
152+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
151153
152154 return rugged_signature_new (
153155 git_commit_committer (commit ),
@@ -172,7 +174,7 @@ static VALUE rb_git_commit_committer_GET(VALUE self)
172174static VALUE rb_git_commit_author_GET (VALUE self )
173175{
174176 git_commit * commit ;
175- Data_Get_Struct (self , git_commit , commit );
177+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
176178
177179 return rugged_signature_new (
178180 git_commit_author (commit ),
@@ -192,7 +194,7 @@ static VALUE rb_git_commit_author_GET(VALUE self)
192194static VALUE rb_git_commit_epoch_time_GET (VALUE self )
193195{
194196 git_commit * commit ;
195- Data_Get_Struct (self , git_commit , commit );
197+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
196198
197199 return ULONG2NUM (git_commit_time (commit ));
198200}
@@ -213,7 +215,7 @@ static VALUE rb_git_commit_tree_GET(VALUE self)
213215 VALUE owner ;
214216 int error ;
215217
216- Data_Get_Struct (self , git_commit , commit );
218+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
217219 owner = rugged_owner (self );
218220
219221 error = git_commit_tree (& tree , commit );
@@ -236,7 +238,7 @@ static VALUE rb_git_commit_tree_id_GET(VALUE self)
236238 git_commit * commit ;
237239 const git_oid * tree_id ;
238240
239- Data_Get_Struct (self , git_commit , commit );
241+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
240242
241243 tree_id = git_commit_tree_id (commit );
242244
@@ -262,7 +264,7 @@ static VALUE rb_git_commit_parents_GET(VALUE self)
262264 VALUE ret_arr , owner ;
263265 int error ;
264266
265- Data_Get_Struct (self , git_commit , commit );
267+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
266268 owner = rugged_owner (self );
267269
268270 parent_count = git_commit_parentcount (commit );
@@ -295,7 +297,7 @@ static VALUE rb_git_commit_parent_ids_GET(VALUE self)
295297 unsigned int n , parent_count ;
296298 VALUE ret_arr ;
297299
298- Data_Get_Struct (self , git_commit , commit );
300+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
299301
300302 parent_count = git_commit_parentcount (commit );
301303 ret_arr = rb_ary_new2 ((long )parent_count );
@@ -352,7 +354,7 @@ static VALUE rb_git_commit_amend(VALUE self, VALUE rb_data)
352354
353355 Check_Type (rb_data , T_HASH );
354356
355- Data_Get_Struct (self , git_commit , commit_to_amend );
357+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit_to_amend );
356358
357359 owner = rugged_owner (self );
358360 Data_Get_Struct (owner , git_repository , repo );
@@ -474,7 +476,7 @@ static VALUE parse_commit_options(struct commit_data *out, git_repository *repo,
474476 if (error < GIT_OK )
475477 goto out ;
476478 } 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 );
478480 if ((error = git_object_dup ((git_object * * ) & parent , (git_object * ) tmp )) < 0 )
479481 goto out ;
480482 } else {
@@ -614,7 +616,7 @@ static VALUE rb_git_commit_to_mbox(int argc, VALUE *argv, VALUE self)
614616 rugged_check_repo (rb_repo );
615617 Data_Get_Struct (rb_repo , git_repository , repo );
616618
617- Data_Get_Struct (self , git_commit , commit );
619+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
618620
619621 if (!NIL_P (rb_options )) {
620622 Check_Type (rb_options , T_HASH );
@@ -673,7 +675,7 @@ static VALUE rb_git_commit_header_field(VALUE self, VALUE rb_field)
673675 int error ;
674676
675677 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 );
677679
678680 error = git_commit_header_field (& header_field , commit , StringValueCStr (rb_field ));
679681
@@ -704,7 +706,7 @@ static VALUE rb_git_commit_header(VALUE self)
704706 git_commit * commit ;
705707 const char * raw_header ;
706708
707- Data_Get_Struct (self , git_commit , commit );
709+ TypedData_Get_Struct (self , git_commit , & rugged_object_type , commit );
708710
709711 raw_header = git_commit_raw_header (commit );
710712 return rb_str_new_utf8 (raw_header );
0 commit comments