summaryrefslogtreecommitdiff
path: root/src/other_tools/root_maps/commit_git_map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/other_tools/root_maps/commit_git_map.cpp')
-rw-r--r--src/other_tools/root_maps/commit_git_map.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/other_tools/root_maps/commit_git_map.cpp b/src/other_tools/root_maps/commit_git_map.cpp
index 8efd628a..479068e2 100644
--- a/src/other_tools/root_maps/commit_git_map.cpp
+++ b/src/other_tools/root_maps/commit_git_map.cpp
@@ -622,19 +622,22 @@ void EnsureCommit(GitRepoInfo const& repo_info,
auto old_repo = GitRepo::Open(old);
auto no_logging = std::make_shared<AsyncMapConsumerLogger>(
[](auto /*unused*/, auto /*unused*/) {});
- if (old_repo and GitRepo::Open(old)->CheckCommitExists(
- repo_info.hash, no_logging)) {
- TakeCommitFromOlderGeneration(old,
- storage_config,
- repo_root,
- repo_info,
- git_cas,
- critical_git_op_map,
- progress,
- ts,
- ws_setter,
- logger);
- return;
+ if (old_repo) {
+ auto check_result =
+ old_repo->CheckCommitExists(repo_info.hash, no_logging);
+ if (check_result and *check_result) {
+ TakeCommitFromOlderGeneration(old,
+ storage_config,
+ repo_root,
+ repo_info,
+ git_cas,
+ critical_git_op_map,
+ progress,
+ ts,
+ ws_setter,
+ logger);
+ return;
+ }
}
}
}