summaryrefslogtreecommitdiff
path: root/src/submodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/submodule.c')
-rw-r--r--src/submodule.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/submodule.c b/src/submodule.c
index e4469efa3..f16d3c5ab 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -787,19 +787,15 @@ int git_submodule_resolve_url(git_buf *out, git_repository *repo, const char *ur
git_buf_sanitize(out);
+ /* We do this in all platforms in case someone on Windows created the .gitmodules */
if (strchr(url, '\\')) {
- char *p;
- if ((error = git_buf_puts(&normalized, url)) < 0)
+ if ((error = git_path_normalize_slashes(&normalized, url)) < 0)
return error;
- for (p = normalized.ptr; *p; p++) {
- if (*p == '\\')
- *p = '/';
- }
-
url = normalized.ptr;
}
+
if (git_path_is_relative(url)) {
if (!(error = get_url_base(out, repo)))
error = git_path_apply_relative(out, url);