summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-08-19 12:50:42 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-08-26 11:36:34 +0200
commit16708110d85714d6ca02623be0cbc99f387e3b77 (patch)
tree3b4de9edc7567a3115d5236649cff4f2b0d22ecf /src
parent426f01ee6be96f3ad7298c09adbe5297e3537f1d (diff)
downloadjustbuild-16708110d85714d6ca02623be0cbc99f387e3b77.tar.gz
GitOpParams: Remove unneeded branch field
The 'branch' field is deprecated, not being used by any of the critical Git operations, thus it can be removed.
Diffstat (limited to 'src')
-rw-r--r--src/other_tools/git_operations/git_ops_types.hpp6
-rw-r--r--src/other_tools/ops_maps/content_cas_map.cpp1
-rw-r--r--src/other_tools/ops_maps/critical_git_op_map.hpp3
-rw-r--r--src/other_tools/ops_maps/git_tree_fetch_map.cpp5
-rw-r--r--src/other_tools/ops_maps/import_to_git_map.cpp3
-rw-r--r--src/other_tools/root_maps/commit_git_map.cpp4
-rw-r--r--src/other_tools/root_maps/content_git_map.cpp6
-rw-r--r--src/other_tools/root_maps/distdir_git_map.cpp1
-rw-r--r--src/other_tools/root_maps/fpath_git_map.cpp3
-rw-r--r--src/other_tools/root_maps/tree_id_git_map.cpp1
10 files changed, 2 insertions, 31 deletions
diff --git a/src/other_tools/git_operations/git_ops_types.hpp b/src/other_tools/git_operations/git_ops_types.hpp
index 7c4b03a5..3dfdd4a8 100644
--- a/src/other_tools/git_operations/git_ops_types.hpp
+++ b/src/other_tools/git_operations/git_ops_types.hpp
@@ -27,27 +27,23 @@
struct GitOpParams {
std::filesystem::path target_path{}; /*key*/
std::string git_hash{}; /*key*/
- std::string branch{}; /*key*/
std::optional<std::string> message{
std::nullopt}; // useful for commits and tags
std::optional<bool> init_bare{std::nullopt}; // useful for git init
GitOpParams(std::filesystem::path const& target_path_,
std::string git_hash_,
- std::string branch_,
std::optional<std::string> message_ = std::nullopt,
std::optional<bool> init_bare_ = std::nullopt)
: target_path{std::filesystem::absolute(ToNormalPath(target_path_))},
git_hash{std::move(git_hash_)},
- branch{std::move(branch_)},
message{std::move(message_)},
init_bare{init_bare_} {};
[[nodiscard]] auto operator==(GitOpParams const& other) const noexcept
-> bool {
// not all fields are keys
- return target_path == other.target_path and
- git_hash == other.git_hash and branch == other.branch;
+ return target_path == other.target_path and git_hash == other.git_hash;
}
};
diff --git a/src/other_tools/ops_maps/content_cas_map.cpp b/src/other_tools/ops_maps/content_cas_map.cpp
index eac0cf36..0c6ccd25 100644
--- a/src/other_tools/ops_maps/content_cas_map.cpp
+++ b/src/other_tools/ops_maps/content_cas_map.cpp
@@ -137,7 +137,6 @@ auto CreateContentCASMap(
{
storage_config->GitRoot(), // target_path
"", // git_hash
- "", // branch
std::nullopt, // message
true // init_bare
},
diff --git a/src/other_tools/ops_maps/critical_git_op_map.hpp b/src/other_tools/ops_maps/critical_git_op_map.hpp
index fa091655..8c75874c 100644
--- a/src/other_tools/ops_maps/critical_git_op_map.hpp
+++ b/src/other_tools/ops_maps/critical_git_op_map.hpp
@@ -34,7 +34,7 @@ using GitOpKeyMap = std::unordered_map<
AsyncMapConsumerLoggerPtr const&)>>;
struct GitOpKey {
- GitOpParams params{"", "", ""}; /* key (with exceptions) */
+ GitOpParams params{"", ""}; /* key (with exceptions) */
GitOpType op_type{GitOpType::DEFAULT_OP}; /* key */
[[nodiscard]] auto operation(GitOpParams const& params,
@@ -96,7 +96,6 @@ struct hash<GitOpParams> {
size_t seed{};
hash_combine<std::filesystem::path>(&seed, ct.target_path);
hash_combine<std::string>(&seed, ct.git_hash);
- hash_combine<std::string>(&seed, ct.branch);
return seed;
}
};
diff --git a/src/other_tools/ops_maps/git_tree_fetch_map.cpp b/src/other_tools/ops_maps/git_tree_fetch_map.cpp
index 550dab7e..cceda079 100644
--- a/src/other_tools/ops_maps/git_tree_fetch_map.cpp
+++ b/src/other_tools/ops_maps/git_tree_fetch_map.cpp
@@ -133,7 +133,6 @@ void TagAndSetRoot(std::string tree_id,
{
repo, // target_path
tree_id, // git_hash
- "", // branch
"Keep referenced tree alive" // message
},
.op_type = GitOpType::KEEP_TREE};
@@ -180,7 +179,6 @@ void TakeTreeFromOlderGeneration(
{
source, // target_path
tree_id, // git_hash
- "", // branch
"Tag commit for fetching" // message
},
.op_type = GitOpType::KEEP_TREE};
@@ -273,7 +271,6 @@ auto CreateGitTreeFetchMap(
{
storage_config->GitRoot(), // target_path
"", // git_hash
- "", // branch
std::nullopt, // message
true // init_bare
},
@@ -458,7 +455,6 @@ auto CreateGitTreeFetchMap(
{
tmp_dir->GetPath(), // target_path
"", // git_hash
- "", // branch
fmt::format("Content of tree {}",
key.hash), // message
},
@@ -604,7 +600,6 @@ auto CreateGitTreeFetchMap(
{
storage_config->GitRoot(), // target_path
*op_result.result, // git_hash
- "", // branch
"Keep referenced tree alive" // message
},
.op_type = GitOpType::KEEP_TAG};
diff --git a/src/other_tools/ops_maps/import_to_git_map.cpp b/src/other_tools/ops_maps/import_to_git_map.cpp
index ddbfa115..7e9331b0 100644
--- a/src/other_tools/ops_maps/import_to_git_map.cpp
+++ b/src/other_tools/ops_maps/import_to_git_map.cpp
@@ -36,7 +36,6 @@ void KeepCommitAndSetTree(
{
storage_config.GitRoot(), // target_path
commit, // git_hash
- "", // branch
"Keep referenced tree alive" // message
},
.op_type = GitOpType::KEEP_TAG};
@@ -107,7 +106,6 @@ auto CreateImportToGitMap(
{
key.target_path, // target_path
"", // git_hash
- "", // branch
fmt::format("Content of {} {}",
key.repo_type,
key.content), // message
@@ -138,7 +136,6 @@ auto CreateImportToGitMap(
{
storage_config->GitRoot(), // target_path
"", // git_hash
- "", // branch
std::nullopt, // message
true // init_bare
},
diff --git a/src/other_tools/root_maps/commit_git_map.cpp b/src/other_tools/root_maps/commit_git_map.cpp
index 9f6943c8..873f7484 100644
--- a/src/other_tools/root_maps/commit_git_map.cpp
+++ b/src/other_tools/root_maps/commit_git_map.cpp
@@ -201,7 +201,6 @@ void TagAndSetRoot(std::filesystem::path const& repo_root,
{
repo_root, // target_path
repo_info.hash, // git_hash
- "", // branch
"Keep referenced tree alive" // message
},
.op_type = GitOpType::KEEP_TAG};
@@ -281,7 +280,6 @@ void TakeCommitFromOlderGeneration(
{
source, // target_path
repo_info.hash, // git_hash
- "", // branch
"Tag commit for fetching" // message
},
.op_type = GitOpType::KEEP_TAG};
@@ -692,7 +690,6 @@ void EnsureCommit(GitRepoInfo const& repo_info,
{
storage_config->GitRoot(), // target_path
"", // git_hash
- "", // branch
std::nullopt, // message
true // init_bare
},
@@ -1104,7 +1101,6 @@ auto CreateCommitGitMap(
{
repo_root, // target_path
"", // git_hash
- "", // branch
std::nullopt, // message
not just_mr_paths->git_checkout_locations.contains(
fetch_repo) // init_bare
diff --git a/src/other_tools/root_maps/content_git_map.cpp b/src/other_tools/root_maps/content_git_map.cpp
index 652f4a25..38aa21a6 100644
--- a/src/other_tools/root_maps/content_git_map.cpp
+++ b/src/other_tools/root_maps/content_git_map.cpp
@@ -260,7 +260,6 @@ void ResolveContentTree(
{
storage_config->GitRoot(), // target_path
resolved_tree_id, // git_hash
- "", // branch
"Keep referenced tree alive" // message
},
.op_type = GitOpType::KEEP_TREE};
@@ -546,7 +545,6 @@ void HandleLocallyKnownTree(
{
storage_config->GitRoot(), // target_path
"", // git_hash
- "", // branch
std::nullopt, // message
true // init_bare
},
@@ -694,7 +692,6 @@ void HandleKnownInOlderGenerationAfterTaggingAndInit(
{
storage_config->GitRoot(), // target_path
tree_id, // git_hash
- "", // branch
"Keep referenced tree alive" // message
},
.op_type = GitOpType::KEEP_TREE};
@@ -760,7 +757,6 @@ void HandleKnownInOlderGenerationAfterTagging(
{
storage_config->GitRoot(), // target_path
"", // git_hash
- "", // branch
std::nullopt, // message
true // init_bare
},
@@ -843,7 +839,6 @@ void HandleKnownInOlderGeneration(
{
source, // target_path
*archive_tree_id, // git_hash
- "", // branch
"Tag commit for fetching" // message
},
.op_type = GitOpType::KEEP_TREE};
@@ -1023,7 +1018,6 @@ auto CreateContentGitMap(
{
storage_config->GitRoot(), // target_path
"", // git_hash
- "", // branch
std::nullopt, // message
true // init_bare
},
diff --git a/src/other_tools/root_maps/distdir_git_map.cpp b/src/other_tools/root_maps/distdir_git_map.cpp
index 9171daae..2d2ad107 100644
--- a/src/other_tools/root_maps/distdir_git_map.cpp
+++ b/src/other_tools/root_maps/distdir_git_map.cpp
@@ -172,7 +172,6 @@ auto CreateDistdirGitMap(
{
storage_config->GitRoot(), // target_path
"", // git_hash
- "", // branch
std::nullopt, // message
true // init_bare
},
diff --git a/src/other_tools/root_maps/fpath_git_map.cpp b/src/other_tools/root_maps/fpath_git_map.cpp
index 2de194d9..d4a46486 100644
--- a/src/other_tools/root_maps/fpath_git_map.cpp
+++ b/src/other_tools/root_maps/fpath_git_map.cpp
@@ -177,7 +177,6 @@ void ResolveFilePathTree(
{
storage_config->GitRoot(), // target_path
resolved_tree_id, // git_hash
- "", // branch
"Keep referenced tree alive" // message
},
.op_type = GitOpType::KEEP_TREE};
@@ -294,7 +293,6 @@ auto CreateFilePathGitMap(
{
*repo_root, // target_path
"", // git_hash
- "", // branch
},
.op_type = GitOpType::GET_HEAD_ID};
critical_git_op_map->ConsumeAfterKeysReady(
@@ -351,7 +349,6 @@ auto CreateFilePathGitMap(
{
storage_config->GitRoot(), // target_path
"", // git_hash
- "", // branch
std::nullopt, // message
true // init_bare
},
diff --git a/src/other_tools/root_maps/tree_id_git_map.cpp b/src/other_tools/root_maps/tree_id_git_map.cpp
index ad06b34d..3a33d11b 100644
--- a/src/other_tools/root_maps/tree_id_git_map.cpp
+++ b/src/other_tools/root_maps/tree_id_git_map.cpp
@@ -234,7 +234,6 @@ auto CreateTreeIdGitMap(
{
storage_config->GitRoot(), // target_path
"", // git_hash
- "", // branch
std::nullopt, // message
true // init_bare
},