summaryrefslogtreecommitdiff
path: root/src/buildtool/file_system/git_repo.hpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-07-18 12:45:39 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-07-19 15:50:15 +0200
commitc7dac3f368213238b752cf394f025de3c94df241 (patch)
tree6be7df311a2fee63f31e2b7b2c92d43396d14250 /src/buildtool/file_system/git_repo.hpp
parentc8394c2ffc3688356cf985d46e8ce56d72050f6a (diff)
downloadjustbuild-c7dac3f368213238b752cf394f025de3c94df241.tar.gz
git_repo: return keep tags on success
... instead of the plain boolean value.
Diffstat (limited to 'src/buildtool/file_system/git_repo.hpp')
-rw-r--r--src/buildtool/file_system/git_repo.hpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/buildtool/file_system/git_repo.hpp b/src/buildtool/file_system/git_repo.hpp
index 2a4a4238..95fa14a6 100644
--- a/src/buildtool/file_system/git_repo.hpp
+++ b/src/buildtool/file_system/git_repo.hpp
@@ -159,11 +159,12 @@ class GitRepo {
/// \brief Create annotated tag for given commit.
/// Only possible with real repository and thus non-thread-safe.
- /// Returns success flag.
+ /// Returns the tag on success.
/// It guarantees the logger is called exactly once with fatal if failure.
[[nodiscard]] auto KeepTag(std::string const& commit,
std::string const& message,
- anon_logger_ptr const& logger) noexcept -> bool;
+ anon_logger_ptr const& logger) noexcept
+ -> std::optional<std::string>;
/// \brief Retrieves the commit of the HEAD reference.
/// Only possible with real repository and thus non-thread-safe.
@@ -188,11 +189,12 @@ class GitRepo {
/// \brief Ensure given tree is kept alive via a tag. It is expected that
/// the tree is part of the repository already.
/// Only possible with real repository and thus non-thread-safe.
- /// Returns success flag.
+ /// Returns the tag on success.
/// It guarantees the logger is called exactly once with fatal if failure.
[[nodiscard]] auto KeepTree(std::string const& tree_id,
std::string const& message,
- anon_logger_ptr const& logger) noexcept -> bool;
+ anon_logger_ptr const& logger) noexcept
+ -> std::optional<std::string>;
/// \brief Get the tree id of a subtree given the root commit
/// Calling it from a fake repository allows thread-safe use.