Skip to content
This repository was archived by the owner on Jan 19, 2021. It is now read-only.

Commit 5de2633

Browse files
committed
Updated ownership
1 parent 405df73 commit 5de2633

12 files changed

+69
-69
lines changed

src/blame.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ blame::~blame() {
1414

1515
blame blame::get_blame_for_buffer(const blame &reference,
1616
const std::string &buffer) {
17-
blame result;
17+
blame result(nullptr, ownership::user);
1818
if (git_blame_buffer(&result.c_ptr_,
1919
const_cast<git_blame *>(reference.c_ptr()),
2020
buffer.c_str(), buffer.size()))

src/commit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ signature commit::committer() const {
4141
}
4242

4343
commit commit::copy() const {
44-
commit result;
44+
commit result(nullptr, ownership::user);
4545
if (git_commit_dup(&result.c_ptr_, c_ptr_))
4646
throw git_exception();
4747
return result;

src/config.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,37 +52,37 @@ std::string config::locate_global_xdg_compatible_config() {
5252
}
5353

5454
config config::new_config() {
55-
config result;
55+
config result(nullptr, ownership::user);
5656
if (git_config_new(&result.c_ptr_))
5757
throw git_exception();
5858
return result;
5959
}
6060

6161
config config::open_default_config() {
62-
config result;
62+
config result(nullptr, ownership::user);
6363
if (git_config_open_default(&result.c_ptr_))
6464
throw git_exception();
6565
return result;
6666
}
6767

6868
config config::open_global_config(config &conf) {
69-
config result;
69+
config result(nullptr, ownership::user);
7070
if (git_config_open_global(&result.c_ptr_, conf.c_ptr_))
7171
throw git_exception();
7272
return result;
7373
}
7474

7575
config config::open_config_at_level(const config &parent,
7676
priority_level level) {
77-
config result;
77+
config result(nullptr, ownership::user);
7878
if (git_config_open_level(&result.c_ptr_, parent.c_ptr(),
7979
static_cast<git_config_level_t>(level)))
8080
throw git_exception();
8181
return result;
8282
}
8383

8484
config::entry config::operator[](const std::string &name) {
85-
config::entry result;
85+
config::entry result(nullptr, ownership::user);
8686
if (git_config_get_entry(&result.c_ptr_, c_ptr_, name.c_str()))
8787
throw git_exception();
8888
return result;
@@ -199,7 +199,7 @@ std::string config::parse_path(const std::string &value) {
199199
}
200200

201201
config config::snapshot() {
202-
config result;
202+
config result(nullptr, ownership::user);
203203
if (git_config_snapshot(&result.c_ptr_, c_ptr_))
204204
throw git_exception();
205205
return result;

src/index.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ oid index::write_tree_to(const repository &repo) {
259259
}
260260

261261
index index::open(const std::string &path) {
262-
index result;
262+
index result(nullptr, ownership::user);
263263
if (git_index_open(&result.c_ptr_, path.c_str()))
264264
throw git_exception();
265265
return result;

src/object.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ std::string object::short_id() const {
2323
}
2424

2525
object object::copy() const {
26-
object result;
26+
object result(nullptr, ownership::user);
2727
if (git_object_dup(&result.c_ptr_, c_ptr_))
2828
throw git_exception();
2929
return result;
@@ -35,7 +35,7 @@ std::string object::object_type_to_string(object_type type) {
3535
}
3636

3737
object object::peel_until(object_type target_type) {
38-
object result;
38+
object result(nullptr, ownership::user);
3939
if (git_object_peel(&result.c_ptr_, c_ptr_,
4040
static_cast<git_object_t>(target_type)))
4141
throw git_exception();

src/rebase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void rebase::finish(const signature &sig) {
3333
}
3434

3535
cppgit2::index rebase::index() {
36-
cppgit2::index result;
36+
cppgit2::index result(nullptr, ownership::user);
3737
if (git_rebase_inmemory_index(&result.c_ptr_, c_ptr_))
3838
throw git_exception();
3939
return result;

src/reference.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ repository reference::owner() const {
7474
}
7575

7676
object reference::peel_until(object::object_type type) {
77-
object result;
77+
object result(nullptr, ownership::user);
7878
if (git_reference_peel(&result.c_ptr_, c_ptr_,
7979
static_cast<git_object_t>(type)))
8080
throw git_exception();
@@ -83,7 +83,7 @@ object reference::peel_until(object::object_type type) {
8383

8484
reference reference::rename(const std::string &new_name, bool force,
8585
const std::string &log_message) {
86-
reference result;
86+
reference result(nullptr, ownership::user);
8787
if (git_reference_rename(&result.c_ptr_, c_ptr_, new_name.c_str(), force,
8888
log_message.c_str()))
8989
throw git_exception();
@@ -98,7 +98,7 @@ reference reference::resolve() {
9898
}
9999

100100
reference reference::set_target(const oid &id, const std::string &log_message) {
101-
reference result;
101+
reference result(nullptr, ownership::user);
102102
if (git_reference_set_target(&result.c_ptr_, c_ptr_, id.c_ptr(),
103103
log_message.c_str()))
104104
throw git_exception();
@@ -107,7 +107,7 @@ reference reference::set_target(const oid &id, const std::string &log_message) {
107107

108108
reference reference::set_symbolic_target(const std::string &target,
109109
const std::string &log_message) {
110-
reference result;
110+
reference result(nullptr, ownership::user);
111111
if (git_reference_symbolic_set_target(&result.c_ptr_, c_ptr_, target.c_str(),
112112
log_message.c_str()))
113113
throw git_exception();

src/refspec.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ bool refspec::is_force_update_enabled() const {
2929
}
3030

3131
refspec refspec::parse(const std::string &input, bool is_fetch) {
32-
refspec result;
32+
refspec result(nullptr, ownership::user);
3333
if (git_refspec_parse(&result.c_ptr_, input.c_str(), is_fetch))
3434
throw git_exception();
3535
return result;

src/remote.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,22 @@ void remote::create_options::set_repository(const cppgit2::repository &repo) {
3636
}
3737

3838
remote remote::copy() const {
39-
remote result;
39+
remote result(nullptr, ownership::user);
4040
if (git_remote_dup(&result.c_ptr_, c_ptr_))
4141
throw git_exception();
4242
return result;
4343
}
4444

4545
remote remote::create_detached_remote(const std::string &url) {
46-
remote result;
46+
remote result(nullptr, ownership::user);
4747
if (git_remote_create_detached(&result.c_ptr_, url.c_str()))
4848
throw git_exception();
4949
return result;
5050
}
5151

5252
remote remote::create_remote(const std::string &url,
5353
const create_options &options) {
54-
remote result;
54+
remote result(nullptr, ownership::user);
5555
if (git_remote_create_with_opts(&result.c_ptr_, url.c_str(), options.c_ptr()))
5656
throw git_exception();
5757
return result;

0 commit comments

Comments
 (0)