Skip to content

Commit f8fa09f

Browse files
committed
Remove uses of deprecated git_buf_free
1 parent 4d76622 commit f8fa09f

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

ext/rugged/rugged.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static VALUE rb_git_prettify_message(int argc, VALUE *argv, VALUE self)
210210
if (!error)
211211
result = rb_enc_str_new(message.ptr, message.size, rb_utf8_encoding());
212212

213-
git_buf_free(&message);
213+
git_buf_dispose(&message);
214214
rugged_exception_check(error);
215215

216216
return result;

ext/rugged/rugged_branch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static VALUE rb_git_branch__remote_name(VALUE rb_repo, const char *canonical_nam
6363
if ((error = git_branch_remote_name(&remote_name, repo, canonical_name)) == GIT_OK)
6464
result = rb_enc_str_new(remote_name.ptr, remote_name.size, rb_utf8_encoding());
6565

66-
git_buf_free(&remote_name);
66+
git_buf_dispose(&remote_name);
6767
rugged_exception_check(error);
6868

6969
return result;

ext/rugged/rugged_commit.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ static VALUE rb_git_commit_to_mbox(int argc, VALUE *argv, VALUE self)
649649
cleanup:
650650

651651
xfree(opts.pathspec.strings);
652-
git_buf_free(&email_patch);
652+
git_buf_dispose(&email_patch);
653653
rugged_exception_check(error);
654654

655655
return rb_email_patch;
@@ -678,7 +678,7 @@ static VALUE rb_git_commit_header_field(VALUE self, VALUE rb_field)
678678
error = git_commit_header_field(&header_field, commit, StringValueCStr(rb_field));
679679

680680
if (error < 0) {
681-
git_buf_free(&header_field);
681+
git_buf_dispose(&header_field);
682682
if (error == GIT_ENOTFOUND)
683683
return Qnil;
684684
rugged_exception_check(error);
@@ -689,7 +689,7 @@ static VALUE rb_git_commit_header_field(VALUE self, VALUE rb_field)
689689
encoding = rb_enc_find(encoding_name);
690690

691691
rb_result = rb_enc_str_new(header_field.ptr, header_field.size, encoding);
692-
git_buf_free(&header_field);
692+
git_buf_dispose(&header_field);
693693
return rb_result;
694694
}
695695

@@ -741,8 +741,8 @@ static VALUE rb_git_commit_extract_signature(int argc, VALUE *argv, VALUE self)
741741
field = NIL_P(rb_field) ? NULL : StringValueCStr(rb_field);
742742
error = git_commit_extract_signature(&signature, &signed_data, repo, &commit_id, field);
743743
if (error < 0) {
744-
git_buf_free(&signature);
745-
git_buf_free(&signed_data);
744+
git_buf_dispose(&signature);
745+
git_buf_dispose(&signed_data);
746746
}
747747

748748
if (error == GIT_ENOTFOUND && giterr_last()->klass == GITERR_OBJECT ) {
@@ -754,8 +754,8 @@ static VALUE rb_git_commit_extract_signature(int argc, VALUE *argv, VALUE self)
754754
rb_str_new(signed_data.ptr, signed_data.size));
755755
}
756756

757-
git_buf_free(&signature);
758-
git_buf_free(&signed_data);
757+
git_buf_dispose(&signature);
758+
git_buf_dispose(&signed_data);
759759

760760
return ret;
761761
}
@@ -821,7 +821,7 @@ static VALUE rb_git_commit_create_to_s(VALUE self, VALUE rb_repo, VALUE rb_data)
821821
rugged_exception_check(error);
822822

823823
ret = rb_str_new_utf8(buf.ptr);
824-
git_buf_free(&buf);
824+
git_buf_dispose(&buf);
825825

826826
return ret;
827827
}

ext/rugged/rugged_config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static VALUE rb_git_config_get(VALUE self, VALUE rb_key)
8989

9090
rugged_exception_check(error);
9191
rb_result = rb_str_new_utf8(buf.ptr);
92-
git_buf_free(&buf);
92+
git_buf_dispose(&buf);
9393

9494
return rb_result;
9595
}

ext/rugged/rugged_note.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ static VALUE rb_git_note_default_ref_GET(VALUE self)
340340

341341
rb_result = rb_enc_str_new(ref_name.ptr, ref_name.size, rb_utf8_encoding());
342342

343-
git_buf_free(&ref_name);
343+
git_buf_dispose(&ref_name);
344344

345345
return rb_result;
346346
}

ext/rugged/rugged_repo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,7 @@ static VALUE rb_git_repo_discover(int argc, VALUE *argv, VALUE klass)
14671467
rugged_exception_check(error);
14681468

14691469
error = git_repository_open(&repo, repository_path.ptr);
1470-
git_buf_free(&repository_path);
1470+
git_buf_dispose(&repository_path);
14711471

14721472
rugged_exception_check(error);
14731473

ext/rugged/rugged_settings.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static VALUE get_search_path(int level)
3737
rugged_exception_check(git_libgit2_opts(GIT_OPT_GET_SEARCH_PATH, level, &buf));
3838

3939
ret = rb_str_new_utf8(buf.ptr);
40-
git_buf_free(&buf);
40+
git_buf_dispose(&buf);
4141

4242
return ret;
4343
}

0 commit comments

Comments
 (0)