diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-07-18 14:30:53 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-07-19 15:50:15 +0200 |
commit | ff8ecea73904cf6348fee13e83814809f55e26f5 (patch) | |
tree | 91fc6e4f576813280073707add1d9bfcf94fe49a | |
parent | c7dac3f368213238b752cf394f025de3c94df241 (diff) | |
download | justbuild-ff8ecea73904cf6348fee13e83814809f55e26f5.tar.gz |
git opertions: return tag for keep operations
-rw-r--r-- | src/other_tools/git_operations/git_operations.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
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}; } |