summaryrefslogtreecommitdiff
path: root/src/other_tools/utils
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2024-12-16 13:38:09 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2024-12-19 16:17:46 +0100
commit827f05a53cb831bd54166ee812752ae3cce2b69b (patch)
treed6c68f39ce0e06384bf1a0e86c847ce1ff2ee9e4 /src/other_tools/utils
parent8fb0006e710e465c9778f0ad9c84e8ad74042960 (diff)
downloadjustbuild-827f05a53cb831bd54166ee812752ae3cce2b69b.tar.gz
Fix struct member initialization
Diffstat (limited to 'src/other_tools/utils')
-rw-r--r--src/other_tools/utils/parse_git_tree.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/other_tools/utils/parse_git_tree.cpp b/src/other_tools/utils/parse_git_tree.cpp
index c14f4c55..c8cd23e7 100644
--- a/src/other_tools/utils/parse_git_tree.cpp
+++ b/src/other_tools/utils/parse_git_tree.cpp
@@ -106,12 +106,11 @@
}
}
// populate struct
- auto info = GitTreeInfo{.tree_hash = *std::move(repo_desc_hash_info),
- .env_vars = std::move(env),
- .inherit_env = std::move(inherit_env),
- .command = std::move(cmd)};
- if (origin) {
- info.origin = *std::move(origin);
- }
+ auto info =
+ GitTreeInfo{.tree_hash = *std::move(repo_desc_hash_info),
+ .env_vars = std::move(env),
+ .inherit_env = std::move(inherit_env),
+ .command = std::move(cmd),
+ .origin = origin ? std::move(*origin) : std::string{}};
return info;
}