From ff8ecea73904cf6348fee13e83814809f55e26f5 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Thu, 18 Jul 2024 14:30:53 +0200 Subject: git opertions: return tag for keep operations --- src/other_tools/git_operations/git_operations.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/other_tools/git_operations/git_operations.cpp') diff --git a/src/other_tools/git_operations/git_operations.cpp b/src/other_tools/git_operations/git_operations.cpp index 81375130..8f5b7ad7 100644 --- a/src/other_tools/git_operations/git_operations.cpp +++ b/src/other_tools/git_operations/git_operations.cpp @@ -102,13 +102,14 @@ auto CriticalGitOps::GitKeepTag(GitOpParams const& crit_op_params, fatal); }); // Create tag of given commit - if (not git_repo->KeepTag(crit_op_params.git_hash, - crit_op_params.message.value(), - wrapped_logger)) { + auto tag_result = git_repo->KeepTag(crit_op_params.git_hash, + crit_op_params.message.value(), + wrapped_logger); + if (not tag_result) { return {.git_cas = nullptr, .result = std::nullopt}; } // success - return {.git_cas = git_repo->GetGitCAS(), .result = ""}; + return {.git_cas = git_repo->GetGitCAS(), .result = *tag_result}; } auto CriticalGitOps::GitGetHeadId(GitOpParams const& crit_op_params, @@ -169,11 +170,12 @@ auto CriticalGitOps::GitKeepTree(GitOpParams const& crit_op_params, fatal); }); // Create tag for given tree - if (not git_repo->KeepTree(crit_op_params.git_hash, - crit_op_params.message.value(), - wrapped_logger)) { + auto tag_result = git_repo->KeepTree(crit_op_params.git_hash, + crit_op_params.message.value(), + wrapped_logger); + if (not tag_result) { return {.git_cas = nullptr, .result = std::nullopt}; } // success - return {.git_cas = git_repo->GetGitCAS(), .result = ""}; + return {.git_cas = git_repo->GetGitCAS(), .result = *tag_result}; } -- cgit v1.2.3