aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_portsdiff.cpp
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-04-14 16:07:54 -0700
committerRobert Schumacher <roschuma@microsoft.com>2017-04-14 16:07:54 -0700
commit20397fc845fac398a1aca2ee17ce5b932fc1a83b (patch)
tree51235bc2602a81a89da9605272a37ca4fc1765a8 /toolsrc/src/commands_portsdiff.cpp
parent8183671a492aa21ec20780a77f923848b0aeca41 (diff)
parent1c08a42091cb0addd1e0c1daf27d24bf4e9d237f (diff)
downloadvcpkg-20397fc845fac398a1aca2ee17ce5b932fc1a83b.tar.gz
vcpkg-20397fc845fac398a1aca2ee17ce5b932fc1a83b.zip
Merge branch 'dev/roschuma/fs-testing'
Diffstat (limited to 'toolsrc/src/commands_portsdiff.cpp')
-rw-r--r--toolsrc/src/commands_portsdiff.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp
index f4b828ecd..e262a8338 100644
--- a/toolsrc/src/commands_portsdiff.cpp
+++ b/toolsrc/src/commands_portsdiff.cpp
@@ -69,11 +69,13 @@ namespace vcpkg::Commands::PortsDiff
static std::map<std::string, VersionT> read_ports_from_commit(const VcpkgPaths& paths, const std::wstring& git_commit_id)
{
+ std::error_code ec;
+ auto& fs = paths.get_filesystem();
const fs::path& git_exe = paths.get_git_exe();
const fs::path dot_git_dir = paths.root / ".git";
const std::wstring ports_dir_name_as_string = paths.ports.filename().native();
const fs::path temp_checkout_path = paths.root / Strings::wformat(L"%s-%s", ports_dir_name_as_string, git_commit_id);
- fs::create_directory(temp_checkout_path);
+ fs.create_directory(temp_checkout_path, ec);
const std::wstring checkout_this_dir = Strings::wformat(LR"(.\%s)", ports_dir_name_as_string); // Must be relative to the root of the repository
const std::wstring cmd = Strings::wformat(LR"("%s" --git-dir="%s" --work-tree="%s" checkout %s -f -q -- %s %s & "%s" reset >NUL)",
@@ -85,9 +87,9 @@ namespace vcpkg::Commands::PortsDiff
L".vcpkg-root",
git_exe.native());
System::cmd_execute_clean(cmd);
- const std::vector<SourceParagraph> source_paragraphs = Paragraphs::load_all_ports(temp_checkout_path / ports_dir_name_as_string);
+ const std::vector<SourceParagraph> source_paragraphs = Paragraphs::load_all_ports(paths.get_filesystem(), temp_checkout_path / ports_dir_name_as_string);
const std::map<std::string, VersionT> names_and_versions = Paragraphs::extract_port_names_and_versions(source_paragraphs);
- fs::remove_all(temp_checkout_path);
+ fs.remove_all(temp_checkout_path, ec);
return names_and_versions;
}