@@ -10,14 +10,14 @@ repository_wrapper::~repository_wrapper()
1010repository_wrapper repository_wrapper::open (std::string_view directory)
1111{
1212 repository_wrapper rw;
13- throwIfError (git_repository_open (&(rw.p_resource ), directory.data ()));
13+ throw_if_error (git_repository_open (&(rw.p_resource ), directory.data ()));
1414 return rw;
1515}
1616
1717repository_wrapper repository_wrapper::init (std::string_view directory, bool bare)
1818{
1919 repository_wrapper rw;
20- throwIfError (git_repository_init (&(rw.p_resource ), directory.data (), bare));
20+ throw_if_error (git_repository_init (&(rw.p_resource ), directory.data (), bare));
2121 return rw;
2222}
2323
@@ -29,14 +29,14 @@ git_repository_state_t repository_wrapper::state() const
2929reference_wrapper repository_wrapper::head () const
3030{
3131 git_reference* ref;
32- throwIfError (git_repository_head (&ref, *this ));
32+ throw_if_error (git_repository_head (&ref, *this ));
3333 return reference_wrapper (ref);
3434}
3535
3636reference_wrapper repository_wrapper::find_reference (std::string_view ref_name) const
3737{
3838 git_reference* ref;
39- throwIfError (git_reference_lookup (&ref, *this , ref_name.data ()));
39+ throw_if_error (git_reference_lookup (&ref, *this , ref_name.data ()));
4040 return reference_wrapper (ref);
4141}
4242
@@ -61,49 +61,49 @@ branch_wrapper repository_wrapper::create_branch(std::string_view name, bool for
6161branch_wrapper repository_wrapper::create_branch (std::string_view name, const commit_wrapper& commit, bool force)
6262{
6363 git_reference* branch = nullptr ;
64- throwIfError (git_branch_create (&branch, *this , name.data (), commit, force));
64+ throw_if_error (git_branch_create (&branch, *this , name.data (), commit, force));
6565 return branch_wrapper (branch);
6666}
6767
6868branch_wrapper repository_wrapper::create_branch (std::string_view name, const annotated_commit_wrapper& commit, bool force)
6969{
7070 git_reference* branch = nullptr ;
71- throwIfError (git_branch_create_from_annotated (&branch, *this , name.data (), commit, force));
71+ throw_if_error (git_branch_create_from_annotated (&branch, *this , name.data (), commit, force));
7272 return branch_wrapper (branch);
7373}
7474
7575branch_wrapper repository_wrapper::find_branch (std::string_view name) const
7676{
7777 git_reference* branch = nullptr ;
78- throwIfError (git_branch_lookup (&branch, *this , name.data (), GIT_BRANCH_LOCAL));
78+ throw_if_error (git_branch_lookup (&branch, *this , name.data (), GIT_BRANCH_LOCAL));
7979 return branch_wrapper (branch);
8080}
8181
8282branch_iterator repository_wrapper::iterate_branches (git_branch_t type) const
8383{
8484 git_branch_iterator* iter = nullptr ;
85- throwIfError (git_branch_iterator_new (&iter, *this , type));
85+ throw_if_error (git_branch_iterator_new (&iter, *this , type));
8686 return branch_iterator (iter);
8787}
8888
8989commit_wrapper repository_wrapper::find_commit (std::string_view ref_name) const
9090{
9191 git_oid oid_parent_commit;
92- throwIfError (git_reference_name_to_id (&oid_parent_commit, *this , ref_name.data ()));
92+ throw_if_error (git_reference_name_to_id (&oid_parent_commit, *this , ref_name.data ()));
9393 return find_commit (oid_parent_commit);
9494}
9595
9696commit_wrapper repository_wrapper::find_commit (const git_oid& id) const
9797{
9898 git_commit* commit;
99- throwIfError (git_commit_lookup (&commit, *this , &id));
99+ throw_if_error (git_commit_lookup (&commit, *this , &id));
100100 return commit_wrapper (commit);
101101}
102102
103103annotated_commit_wrapper repository_wrapper::find_annotated_commit (const git_oid& id) const
104104{
105105 git_annotated_commit* commit;
106- throwIfError (git_annotated_commit_lookup (&commit, *this , &id));
106+ throw_if_error (git_annotated_commit_lookup (&commit, *this , &id));
107107 return annotated_commit_wrapper (commit);
108108}
109109
@@ -116,10 +116,10 @@ std::optional<object_wrapper> repository_wrapper::revparse_single(std::string_vi
116116
117117void repository_wrapper::set_head (std::string_view ref_name)
118118{
119- throwIfError (git_repository_set_head (*this , ref_name.data ()));
119+ throw_if_error (git_repository_set_head (*this , ref_name.data ()));
120120}
121121
122122void repository_wrapper::set_head_detached (const annotated_commit_wrapper& commit)
123123{
124- throwIfError (git_repository_set_head_detached_from_annotated (*this , commit));
124+ throw_if_error (git_repository_set_head_detached_from_annotated (*this , commit));
125125}
0 commit comments