summaryrefslogtreecommitdiff
path: root/src/other_tools/git_operations/git_repo_remote.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/other_tools/git_operations/git_repo_remote.cpp')
-rw-r--r--src/other_tools/git_operations/git_repo_remote.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/other_tools/git_operations/git_repo_remote.cpp b/src/other_tools/git_operations/git_repo_remote.cpp
index ffbb0222..9635863e 100644
--- a/src/other_tools/git_operations/git_repo_remote.cpp
+++ b/src/other_tools/git_operations/git_repo_remote.cpp
@@ -23,6 +23,7 @@
#include <utility> // std::move
#include "fmt/core.h"
+#include "gsl/gsl"
#include "nlohmann/json.hpp"
#include "src/buildtool/file_system/file_system_manager.hpp"
#include "src/buildtool/file_system/git_utils.hpp"
@@ -64,21 +65,17 @@ struct FetchIntoODBBackend {
[[maybe_unused]] git_odb* odb,
git_indexer_progress_cb progress_cb,
void* progress_payload) -> int {
- if (_backend != nullptr) {
- auto* b = reinterpret_cast<FetchIntoODBBackend*>(_backend); // NOLINT
- return git_odb_write_pack(
- _writepack, b->target_odb, progress_cb, progress_payload);
- }
- return GIT_ERROR;
+ Ensures(_backend != nullptr);
+ auto* b = reinterpret_cast<FetchIntoODBBackend*>(_backend); // NOLINT
+ return git_odb_write_pack(
+ _writepack, b->target_odb, progress_cb, progress_payload);
}
[[nodiscard]] auto fetch_backend_exists(git_odb_backend* _backend,
const git_oid* oid) -> int {
- if (_backend != nullptr) {
- auto* b = reinterpret_cast<FetchIntoODBBackend*>(_backend); // NOLINT
- return git_odb_exists(b->target_odb, oid);
- }
- return GIT_ERROR;
+ Ensures(_backend != nullptr);
+ auto* b = reinterpret_cast<FetchIntoODBBackend*>(_backend); // NOLINT
+ return git_odb_exists(b->target_odb, oid);
}
void fetch_backend_free(git_odb_backend* /*_backend*/) {}