summaryrefslogtreecommitdiff
path: root/test/buildtool/build_engine/base_maps/test_repo.hpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-02-16 16:20:34 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-02-17 16:27:50 +0100
commit307da10caa951c5e8d6d6f256ee3d81a66ed6bb3 (patch)
treead5fcf8650d46957b362326a6956f4c290c2ced8 /test/buildtool/build_engine/base_maps/test_repo.hpp
parentae8db3f7484e5b6e7ef6b0f0f9243d84820c2236 (diff)
downloadjustbuild-307da10caa951c5e8d6d6f256ee3d81a66ed6bb3.tar.gz
tests: Add proper quoting when system calling the shell
Diffstat (limited to 'test/buildtool/build_engine/base_maps/test_repo.hpp')
-rw-r--r--test/buildtool/build_engine/base_maps/test_repo.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/buildtool/build_engine/base_maps/test_repo.hpp b/test/buildtool/build_engine/base_maps/test_repo.hpp
index 6b0ca1f1..00185432 100644
--- a/test/buildtool/build_engine/base_maps/test_repo.hpp
+++ b/test/buildtool/build_engine/base_maps/test_repo.hpp
@@ -19,6 +19,7 @@
#include "src/buildtool/common/repository_config.hpp"
#include "src/buildtool/file_system/file_system_manager.hpp"
+#include "test/utils/shell_quoting.hpp"
static auto const kBasePath =
std::filesystem::path{"test/buildtool/build_engine/base_maps"};
@@ -46,8 +47,9 @@ static auto const kJsonTreeId =
auto repo_path =
GetTestDir() / "test_repo" /
std::filesystem::path{std::to_string(counter++)}.filename();
- auto cmd = fmt::format(
- "git clone --bare {} {}", kBundlePath.string(), repo_path.string());
+ auto cmd = fmt::format("git clone --bare {} {}",
+ QuoteForShell(kBundlePath.string()),
+ QuoteForShell(repo_path.string()));
if (std::system(cmd.c_str()) == 0) {
return repo_path;
}