summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/other_tools/root_maps/TARGETS1
-rw-r--r--src/other_tools/root_maps/commit_git_map.cpp10
2 files changed, 5 insertions, 6 deletions
diff --git a/src/other_tools/root_maps/TARGETS b/src/other_tools/root_maps/TARGETS
index 9452ca23..42739b92 100644
--- a/src/other_tools/root_maps/TARGETS
+++ b/src/other_tools/root_maps/TARGETS
@@ -47,6 +47,7 @@
, ["src/other_tools/ops_maps", "critical_git_op_map"]
, ["src/other_tools/ops_maps", "import_to_git_map"]
, ["src/utils/cpp", "hash_combine"]
+ , ["src/utils/cpp", "path"]
]
, "stage": ["src", "other_tools", "root_maps"]
, "private-deps":
diff --git a/src/other_tools/root_maps/commit_git_map.cpp b/src/other_tools/root_maps/commit_git_map.cpp
index a64ccc49..e5910b9b 100644
--- a/src/other_tools/root_maps/commit_git_map.cpp
+++ b/src/other_tools/root_maps/commit_git_map.cpp
@@ -29,6 +29,7 @@
#include "src/other_tools/just_mr/progress_reporting/statistics.hpp"
#include "src/other_tools/root_maps/root_utils.hpp"
#include "src/other_tools/utils/curl_url_handle.hpp"
+#include "src/utils/cpp/path.hpp"
namespace {
@@ -38,14 +39,11 @@ namespace {
static auto const kRelPath = std::string{"./"};
static auto const kFileScheme = std::string{"file://"};
- if (url.starts_with(kAbsPath)) {
- return url;
- }
- if (url.starts_with(kRelPath)) {
- return url.substr(kRelPath.length());
+ if (url.starts_with(kAbsPath) or url.starts_with(kRelPath)) {
+ return ToNormalPath(url).string();
}
if (url.starts_with(kFileScheme)) {
- return url.substr(kFileScheme.length());
+ return ToNormalPath(url.substr(kFileScheme.length())).string();
}
return std::nullopt;