summaryrefslogtreecommitdiff
path: root/src/other_tools/git_operations/git_operations.cpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-07-18 14:30:53 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-07-19 15:50:15 +0200
commitff8ecea73904cf6348fee13e83814809f55e26f5 (patch)
tree91fc6e4f576813280073707add1d9bfcf94fe49a /src/other_tools/git_operations/git_operations.cpp
parentc7dac3f368213238b752cf394f025de3c94df241 (diff)
downloadjustbuild-ff8ecea73904cf6348fee13e83814809f55e26f5.tar.gz
git opertions: return tag for keep operations
Diffstat (limited to 'src/other_tools/git_operations/git_operations.cpp')
-rw-r--r--src/other_tools/git_operations/git_operations.cpp18
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};
}