From 827f05a53cb831bd54166ee812752ae3cce2b69b Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Mon, 16 Dec 2024 13:38:09 +0100 Subject: Fix struct member initialization --- src/other_tools/utils/parse_git_tree.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/other_tools/utils/parse_git_tree.cpp') 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; } -- cgit v1.2.3