44 * \date Created on March 20, 2023
55 * \brief Implementation of wrappers for libgit2 functions.
66 *
7- * \copyright Copyright 2023 Deutsches Elektronen-Synchrotron (DESY), Hamburg
7+ * \copyright Copyright 2023-2025 Deutsches Elektronen-Synchrotron (DESY), Hamburg
88 *
99 * This program is free software: you can redistribute it and/or modify
1010 * it under the terms of the GNU Lesser General Public License as published
2323// SPDX-License-Identifier: LGPL-2.1-or-later
2424
2525#include < git2.h>
26- #include < gul14 /cat.h>
27- #include < gul14 /finalizer.h>
26+ #include < gul17 /cat.h>
27+ #include < gul17 /finalizer.h>
2828
2929#include " libgit4cpp/wrapper_functions.h"
3030#include " libgit4cpp/Error.h"
@@ -36,7 +36,7 @@ LibGitRepository repository_open(const std::string& repo_path)
3636 git_repository* repo;
3737 if (git_repository_open (&repo, repo_path.c_str ()))
3838 {
39- // gul14 ::cat("repository_open: ", git_error_last()->message);
39+ // gul17 ::cat("repository_open: ", git_error_last()->message);
4040 repo = nullptr ;
4141 }
4242
@@ -55,7 +55,7 @@ LibGitRepository repository_init(const std::string& repo_path, bool is_bare)
5555 int error = git_repository_init_ext (&repo, repo_path.c_str (), &opts);
5656 if (error)
5757 {
58- // gul14 ::cat("repository_init: ", git_error_last()->message);
58+ // gul17 ::cat("repository_init: ", git_error_last()->message);
5959 repo = nullptr ;
6060 }
6161 return { repo, git_repository_free };
@@ -66,7 +66,7 @@ LibGitIndex repository_index(git_repository* repo)
6666 git_index* index;
6767 if (git_repository_index (&index, repo))
6868 {
69- // gul14 ::cat("repository_index: ", git_error_last()->message);
69+ // gul17 ::cat("repository_index: ", git_error_last()->message);
7070 index = nullptr ;
7171 }
7272 return { index, git_index_free };
@@ -77,7 +77,7 @@ LibGitSignature signature_default(git_repository* repo)
7777 git_signature* signature;
7878 if (git_signature_default (&signature, repo))
7979 {
80- // gul14 ::cat("signature_default: ", git_error_last()->message);
80+ // gul17 ::cat("signature_default: ", git_error_last()->message);
8181 signature = nullptr ;
8282 }
8383 return { signature, git_signature_free };
@@ -88,7 +88,7 @@ LibGitSignature signature_new(const std::string& name, const std::string& email,
8888 git_signature* signature;
8989 if (git_signature_new (&signature, name.c_str (), email.c_str (), time, offset))
9090 {
91- // gul14 ::cat("signature_new: ", git_error_last()->message);
91+ // gul17 ::cat("signature_new: ", git_error_last()->message);
9292 signature = nullptr ;
9393 }
9494 return { signature, git_signature_free };
@@ -99,7 +99,7 @@ LibGitTree tree_lookup(git_repository* repo, git_oid tree_id)
9999 git_tree* tree;
100100 if (git_tree_lookup (&tree, repo, &tree_id))
101101 {
102- // gul14 ::cat("tree_lookup: ", git_error_last()->message);
102+ // gul17 ::cat("tree_lookup: ", git_error_last()->message);
103103 tree = nullptr ;
104104 }
105105 return { tree, git_tree_free };
@@ -111,7 +111,7 @@ LibGitRemote remote_create(git_repository* repo, const std::string& remote_name,
111111 git_remote* remote;
112112 if (git_remote_create (&remote, repo, remote_name.c_str (), url.c_str ()))
113113 {
114- // gul14 ::cat("remote_create: ", git_error_last()->message);
114+ // gul17 ::cat("remote_create: ", git_error_last()->message);
115115 remote = nullptr ;
116116 }
117117 return { remote, git_remote_free };
@@ -130,7 +130,7 @@ LibGitStatusList status_list_new(git_repository* repo, const git_status_options&
130130 git_status_list* status;
131131 if (git_status_list_new (&status, repo, &status_opt))
132132 {
133- // gul14 ::cat("status_list_new: ", git_error_last()->message);
133+ // gul17 ::cat("status_list_new: ", git_error_last()->message);
134134 status = nullptr ;
135135 }
136136 return { status, git_status_list_free };
@@ -141,7 +141,7 @@ LibGitReference repository_head(git_repository* repo)
141141 git_reference* reference;
142142 if (git_repository_head (&reference, repo))
143143 {
144- // gul14 ::cat("reposiotry_head: ", git_error_last()->message);
144+ // gul17 ::cat("reposiotry_head: ", git_error_last()->message);
145145 reference = nullptr ;
146146 }
147147 return { reference, git_reference_free };
@@ -152,7 +152,7 @@ LibGitRepository clone(const std::string& url, const std::string& repo_path)
152152 git_repository* repo;
153153 if (git_clone (&repo, url.c_str (), repo_path.c_str (), nullptr ))
154154 {
155- // gul14 ::cat("branch_remote_name: ", git_error_last()->message);
155+ // gul17 ::cat("branch_remote_name: ", git_error_last()->message);
156156 repo = nullptr ;
157157 }
158158 return { repo, git_repository_free };
@@ -164,7 +164,7 @@ LibGitReference branch_lookup(git_repository* repo, const std::string& branch_na
164164 git_reference* ref;
165165 if (git_branch_lookup (&ref, repo, branch_name.c_str (), branch_type))
166166 {
167- // gul14 ::cat("branch_lookup: ", git_error_last()->message);
167+ // gul17 ::cat("branch_lookup: ", git_error_last()->message);
168168 ref = nullptr ;
169169 }
170170 return { ref, git_reference_free };
@@ -191,10 +191,10 @@ LibGitReference branch_create(git_repository* repo, const std::string& new_branc
191191std::string branch_remote_name (git_repository* repo, const std::string& branch_name)
192192{
193193 git_buf buf{ };
194- auto _ = gul14 ::finally ([buf_addr = &buf]() { git_buf_dispose (buf_addr); });
194+ auto _ = gul17 ::finally ([buf_addr = &buf]() { git_buf_dispose (buf_addr); });
195195 auto error = git_branch_remote_name (&buf, repo, branch_name.c_str ());
196196 if (error) {
197- throw Error{ error, gul14 ::cat (" branch_remote_name: " , git_error_last ()->message ) };
197+ throw Error{ error, gul17 ::cat (" branch_remote_name: " , git_error_last ()->message ) };
198198 }
199199 auto ret = std::string{ buf.ptr };
200200 return ret;
@@ -204,15 +204,15 @@ std::string reference_shorthand(const git_reference* ref)
204204{
205205 const char * name_cstr = git_reference_shorthand (ref);
206206 if (name_cstr == nullptr )
207- throw Error{gul14 ::cat (" reference_shorthand: " , git_error_last ()->message ) };
207+ throw Error{gul17 ::cat (" reference_shorthand: " , git_error_last ()->message ) };
208208 return std::string (name_cstr);
209209}
210210
211211std::string reference_name (git_reference* ref)
212212{
213213 const char * name_cstr = git_reference_name (ref);
214214 if (name_cstr == nullptr )
215- throw Error{gul14 ::cat (" reference_name: " , git_error_last ()->message ) };
215+ throw Error{gul17 ::cat (" reference_name: " , git_error_last ()->message ) };
216216 return std::string (name_cstr);
217217}
218218
@@ -221,7 +221,7 @@ LibGitReference parse_reference_from_name(git_repository* repo, const std::strin
221221 git_reference* ref;
222222 auto error = git_reference_dwim (&ref, repo, name.c_str ());
223223 if (error)
224- throw Error{gul14 ::cat (" parse_reference_from_name: " , git_error_last ()->message ) };
224+ throw Error{gul17 ::cat (" parse_reference_from_name: " , git_error_last ()->message ) };
225225 return {ref, git_reference_free};
226226}
227227
@@ -230,7 +230,7 @@ LibGitBranchIterator branch_iterator(git_repository* repo, git_branch_t flag)
230230 git_branch_iterator* iter;
231231 auto error = git_branch_iterator_new (&iter, repo, flag);
232232 if (error)
233- throw Error{gul14 ::cat (" get_branch_iterator: " , git_error_last ()->message ) };
233+ throw Error{gul17 ::cat (" get_branch_iterator: " , git_error_last ()->message ) };
234234 return {iter, git_branch_iterator_free};
235235}
236236
0 commit comments