Skip to content

Commit 5151599

Browse files
Whitespace 💄
1 parent e1d6bab commit 5151599

File tree

4 files changed

+46
-46
lines changed

4 files changed

+46
-46
lines changed

ext/rugged/rugged_odb.c

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ VALUE rb_cRuggedOdb;
3737
* needs to be assigned using `Odb#add_backend`.
3838
*/
3939
static 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
*/
7373
static 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

9393
static 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

104104
static 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

121121
void 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
}

ext/rugged/rugged_odb_backend_loose.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,21 @@ VALUE rb_cRuggedOdbBackendLoose;
2929

3030
void rb_git_odb_backend__free(git_odb_backend *backend)
3131
{
32-
if (backend) backend->free(backend);
32+
if (backend) backend->free(backend);
3333
}
3434

3535
static VALUE rb_git_odb_backend_loose_new(VALUE self, VALUE rb_path, VALUE rb_compression_level, VALUE rb_do_fsync, VALUE rb_dir_mode, VALUE rb_file_mode)
3636
{
37-
git_odb_backend *backend;
37+
git_odb_backend *backend;
3838

39-
rugged_exception_check(git_odb_backend_loose(&backend, StringValueCStr(rb_path), NUM2INT(rb_compression_level), NUM2INT(rb_do_fsync), NUM2INT(rb_dir_mode), NUM2INT(rb_file_mode)));
39+
rugged_exception_check(git_odb_backend_loose(&backend, StringValueCStr(rb_path), NUM2INT(rb_compression_level), NUM2INT(rb_do_fsync), NUM2INT(rb_dir_mode), NUM2INT(rb_file_mode)));
4040

41-
return Data_Wrap_Struct(self, NULL, rb_git_odb_backend__free, backend);
41+
return Data_Wrap_Struct(self, NULL, rb_git_odb_backend__free, backend);
4242
}
4343

4444
void Init_rugged_odb_backend_loose(void)
4545
{
4646
rb_cRuggedOdbBackendLoose = rb_define_class_under(rb_cRuggedOdbBackend, "Loose", rb_cRuggedOdbBackend);
4747

48-
rb_define_singleton_method(rb_cRuggedOdbBackendLoose, "new", rb_git_odb_backend_loose_new, 5);
48+
rb_define_singleton_method(rb_cRuggedOdbBackendLoose, "new", rb_git_odb_backend_loose_new, 5);
4949
}

ext/rugged/rugged_odb_backend_one_pack.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,21 @@ VALUE rb_cRuggedOdbBackendOnePack;
2929

3030
static void rb_git_odb_backend__free(git_odb_backend *backend)
3131
{
32-
if (backend) backend->free(backend);
32+
if (backend) backend->free(backend);
3333
}
3434

3535
static VALUE rb_git_odb_backend_one_pack_new(VALUE self, VALUE rb_path)
3636
{
37-
git_odb_backend *backend;
37+
git_odb_backend *backend;
3838

39-
rugged_exception_check(git_odb_backend_one_pack(&backend, StringValueCStr(rb_path)));
39+
rugged_exception_check(git_odb_backend_one_pack(&backend, StringValueCStr(rb_path)));
4040

41-
return Data_Wrap_Struct(self, NULL, rb_git_odb_backend__free, backend);
41+
return Data_Wrap_Struct(self, NULL, rb_git_odb_backend__free, backend);
4242
}
4343

4444
void Init_rugged_odb_backend_one_pack(void)
4545
{
4646
rb_cRuggedOdbBackendOnePack = rb_define_class_under(rb_cRuggedOdbBackend, "OnePack", rb_cRuggedOdbBackend);
4747

48-
rb_define_singleton_method(rb_cRuggedOdbBackendOnePack, "new", rb_git_odb_backend_one_pack_new, 1);
48+
rb_define_singleton_method(rb_cRuggedOdbBackendOnePack, "new", rb_git_odb_backend_one_pack_new, 1);
4949
}

ext/rugged/rugged_odb_backend_pack.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,21 @@ VALUE rb_cRuggedOdbBackendPack;
2929

3030
static void rb_git_odb_backend__free(git_odb_backend *backend)
3131
{
32-
if (backend) backend->free(backend);
32+
if (backend) backend->free(backend);
3333
}
3434

3535
static VALUE rb_git_odb_backend_pack_new(VALUE self, VALUE rb_path)
3636
{
37-
git_odb_backend *backend;
37+
git_odb_backend *backend;
3838

39-
rugged_exception_check(git_odb_backend_pack(&backend, StringValueCStr(rb_path)));
39+
rugged_exception_check(git_odb_backend_pack(&backend, StringValueCStr(rb_path)));
4040

41-
return Data_Wrap_Struct(self, NULL, rb_git_odb_backend__free, backend);
41+
return Data_Wrap_Struct(self, NULL, rb_git_odb_backend__free, backend);
4242
}
4343

4444
void Init_rugged_odb_backend_pack(void)
4545
{
4646
rb_cRuggedOdbBackendPack = rb_define_class_under(rb_cRuggedOdbBackend, "Pack", rb_cRuggedOdbBackend);
4747

48-
rb_define_singleton_method(rb_cRuggedOdbBackendPack, "new", rb_git_odb_backend_pack_new, 1);
48+
rb_define_singleton_method(rb_cRuggedOdbBackendPack, "new", rb_git_odb_backend_pack_new, 1);
4949
}

0 commit comments

Comments
 (0)