From e5df21209e665f03b57cfaa83707e30e14012097 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Fri, 29 Nov 2024 16:26:30 +0100 Subject: Add aditional checks to initializations of git repos --- src/other_tools/git_operations/git_operations.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 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 e21e55d4..aacaf65e 100644 --- a/src/other_tools/git_operations/git_operations.cpp +++ b/src/other_tools/git_operations/git_operations.cpp @@ -44,7 +44,7 @@ auto CriticalGitOps::GitInitialCommit(GitOpParams const& crit_op_params, // Create and open a GitRepoRemote at given target location auto git_repo = GitRepoRemote::InitAndOpen(crit_op_params.target_path, /*is_bare=*/false); - if (git_repo == std::nullopt) { + if (git_repo == std::nullopt or git_repo->GetGitCAS() == nullptr) { (*logger)(fmt::format("could not initialize git repository {}", crit_op_params.target_path.string()), true /*fatal*/); @@ -83,7 +83,7 @@ auto CriticalGitOps::GitEnsureInit(GitOpParams const& crit_op_params, auto git_repo = GitRepoRemote::InitAndOpen( crit_op_params.target_path, /*is_bare=*/crit_op_params.init_bare.value()); - if (git_repo == std::nullopt) { + if (git_repo == std::nullopt or git_repo->GetGitCAS() == nullptr) { (*logger)( fmt::format("could not initialize {} git repository {}", crit_op_params.init_bare.value() ? "bare" : "non-bare", -- cgit v1.2.3