@@ -37,9 +37,9 @@ VALUE rb_cRuggedOdb;
3737 * needs to be assigned using `Odb#add_backend`.
3838 */
3939static VALUE rb_git_odb_new (VALUE klass ) {
40- git_odb * odb ;
41- rugged_exception_check (git_odb_new (& odb ));
42- return Data_Wrap_Struct (klass , NULL , git_odb_free , odb );
40+ git_odb * odb ;
41+ rugged_exception_check (git_odb_new (& odb ));
42+ return Data_Wrap_Struct (klass , NULL , git_odb_free , odb );
4343}
4444
4545/*
@@ -52,13 +52,13 @@ static VALUE rb_git_odb_new(VALUE klass) {
5252 * `dir` needs to boint to the objects folder to be used
5353 * by the filesystem backends.
5454 */
55- static VALUE rb_git_odb_open (VALUE klass , VALUE rb_path ) {
56- git_odb * odb ;
55+ static VALUE rb_git_odb_open (VALUE klass , VALUE rb_path ) {
56+ git_odb * odb ;
5757
58- rugged_exception_check (git_odb_open (& odb , StringValueCStr (rb_path )));
58+ rugged_exception_check (git_odb_open (& odb , StringValueCStr (rb_path )));
5959
60- return Data_Wrap_Struct (klass , NULL , git_odb_free , odb );
61- }
60+ return Data_Wrap_Struct (klass , NULL , git_odb_free , odb );
61+ }
6262
6363/*
6464 * call-seq:
@@ -72,59 +72,59 @@ static VALUE rb_git_odb_new(VALUE klass) {
7272 */
7373static VALUE rb_git_odb_add_backend (VALUE self , VALUE rb_backend , VALUE rb_priority )
7474{
75- git_odb * odb ;
76- git_odb_backend * backend ;
75+ git_odb * odb ;
76+ git_odb_backend * backend ;
7777
78- Data_Get_Struct (self , git_odb , odb );
79- Data_Get_Struct (rb_backend , git_odb_backend , backend );
78+ Data_Get_Struct (self , git_odb , odb );
79+ Data_Get_Struct (rb_backend , git_odb_backend , backend );
8080
81- if (!backend )
82- rb_exc_raise (rb_exc_new2 (rb_eRuntimeError , "Can not reuse odb backend instances" ));
81+ if (!backend )
82+ rb_exc_raise (rb_exc_new2 (rb_eRuntimeError , "Can not reuse odb backend instances" ));
8383
84- rugged_exception_check (git_odb_add_backend (odb , backend , NUM2INT (rb_priority )));
84+ rugged_exception_check (git_odb_add_backend (odb , backend , NUM2INT (rb_priority )));
8585
86- // libgit2 has taken ownership of the backend, so we should make sure
87- // we don't try to free it.
88- ((struct RData * )rb_backend )-> data = NULL ;
86+ // libgit2 has taken ownership of the backend, so we should make sure
87+ // we don't try to free it.
88+ ((struct RData * )rb_backend )-> data = NULL ;
8989
90- return self ;
90+ return self ;
9191}
9292
9393static int cb_odb__each (const git_oid * id , void * data )
9494{
95- char out [40 ];
95+ char out [40 ];
9696 struct rugged_cb_payload * payload = data ;
9797
98- git_oid_fmt (out , id );
99- rb_protect (rb_yield , rb_str_new (out , 40 ), & payload -> exception );
98+ git_oid_fmt (out , id );
99+ rb_protect (rb_yield , rb_str_new (out , 40 ), & payload -> exception );
100100
101- return payload -> exception ? GIT_ERROR : GIT_OK ;
101+ return payload -> exception ? GIT_ERROR : GIT_OK ;
102102}
103103
104104static VALUE rb_git_odb_each (VALUE self )
105105{
106- git_odb * odb ;
107- int error ;
108- struct rugged_cb_payload payload = { self , 0 };
106+ git_odb * odb ;
107+ int error ;
108+ struct rugged_cb_payload payload = { self , 0 };
109109
110- Data_Get_Struct (self , git_odb , odb );
110+ Data_Get_Struct (self , git_odb , odb );
111111
112- error = git_odb_foreach (odb , & cb_odb__each , & payload );
112+ error = git_odb_foreach (odb , & cb_odb__each , & payload );
113113
114114 if (payload .exception )
115115 rb_jump_tag (payload .exception );
116116 rugged_exception_check (error );
117117
118- return Qnil ;
118+ return Qnil ;
119119}
120120
121121void Init_rugged_odb (void )
122122{
123123 rb_cRuggedOdb = rb_define_class_under (rb_mRugged , "Odb" , rb_cObject );
124124
125- rb_define_singleton_method (rb_cRuggedOdb , "new" , rb_git_odb_new , 0 );
125+ rb_define_singleton_method (rb_cRuggedOdb , "new" , rb_git_odb_new , 0 );
126126 rb_define_singleton_method (rb_cRuggedOdb , "open" , rb_git_odb_open , 1 );
127127
128128 rb_define_method (rb_cRuggedOdb , "add_backend" , rb_git_odb_add_backend , 2 );
129- rb_define_method (rb_cRuggedOdb , "each" , rb_git_odb_each , 0 );
129+ rb_define_method (rb_cRuggedOdb , "each" , rb_git_odb_each , 0 );
130130}
0 commit comments