summaryrefslogtreecommitdiff
path: root/src/other_tools/git_operations/git_operations.cpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-02-15 17:12:15 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-02-17 16:27:50 +0100
commit65944566d8d3ae81d3dc3acb8c82944f5698ca5d (patch)
tree9700c15732d21dc03fd2f33c600e2ead80694c2c /src/other_tools/git_operations/git_operations.cpp
parentebe7695ee5803dd3c2bb4f22f5e12d776c985d56 (diff)
downloadjustbuild-65944566d8d3ae81d3dc3acb8c82944f5698ca5d.tar.gz
structure cleanup: move remote operations of GitRepo to other_tools...
...in order to not include unwanted dependencies in just proper. The new class extends the GitRepo class used for just's Git tree operations and gets used in all of just-mr's async maps.
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, 9 insertions, 9 deletions
diff --git a/src/other_tools/git_operations/git_operations.cpp b/src/other_tools/git_operations/git_operations.cpp
index cdefaef9..b68c54e7 100644
--- a/src/other_tools/git_operations/git_operations.cpp
+++ b/src/other_tools/git_operations/git_operations.cpp
@@ -17,15 +17,15 @@
#include <vector>
#include "src/buildtool/file_system/file_system_manager.hpp"
-#include "src/buildtool/file_system/git_repo.hpp"
#include "src/buildtool/logging/logger.hpp"
+#include "src/other_tools/git_operations/git_repo_remote.hpp"
auto CriticalGitOps::GitInitialCommit(GitOpParams const& crit_op_params,
AsyncMapConsumerLoggerPtr const& logger)
-> GitOpValue {
- // Create and open a GitRepo at given target location
- auto git_repo =
- GitRepo::InitAndOpen(crit_op_params.target_path, /*is_bare=*/false);
+ // 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) {
(*logger)(fmt::format("could not initialize git repository {}",
crit_op_params.target_path.string()),
@@ -60,9 +60,9 @@ auto CriticalGitOps::GitEnsureInit(GitOpParams const& crit_op_params,
return GitOpValue({nullptr, std::nullopt});
}
// Create and open a GitRepo at given target location
- auto git_repo =
- GitRepo::InitAndOpen(crit_op_params.target_path,
- /*is_bare=*/crit_op_params.init_bare.value());
+ auto git_repo = GitRepoRemote::InitAndOpen(
+ crit_op_params.target_path,
+ /*is_bare=*/crit_op_params.init_bare.value());
if (git_repo == std::nullopt) {
(*logger)(
fmt::format("could not initialize {} git repository {}",
@@ -86,7 +86,7 @@ auto CriticalGitOps::GitKeepTag(GitOpParams const& crit_op_params,
return GitOpValue({nullptr, std::nullopt});
}
// Open a GitRepo at given location
- auto git_repo = GitRepo::Open(crit_op_params.target_path);
+ auto git_repo = GitRepoRemote::Open(crit_op_params.target_path);
if (git_repo == std::nullopt) {
(*logger)(fmt::format("could not open git repository {}",
crit_op_params.target_path.string()),
@@ -120,7 +120,7 @@ auto CriticalGitOps::GitGetHeadId(GitOpParams const& crit_op_params,
return GitOpValue({nullptr, std::nullopt});
}
// Open a GitRepo at given location
- auto git_repo = GitRepo::Open(crit_op_params.target_path);
+ auto git_repo = GitRepoRemote::Open(crit_op_params.target_path);
if (git_repo == std::nullopt) {
(*logger)(fmt::format("could not open git repository {}",
crit_op_params.target_path.string()),