Commit d6c7ca3ea99aa97d520d741dee2a8542cd0f2e38

Edward Thomson 2021-09-25T14:36:25

win32: posixify the output of p_getcwd Make p_getcwd match the rest of our win32 path handling semantics. (This is currently only used in tests, which is why this disparity went unnoticed.)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c
index 66d12cf..8af07e6 100644
--- a/src/win32/posix_w32.c
+++ b/src/win32/posix_w32.c
@@ -648,6 +648,8 @@ int p_getcwd(char *buffer_out, size_t size)
 	if (!cwd)
 		return -1;
 
+	git_win32_path_remove_namespace(cwd, wcslen(cwd));
+
 	/* Convert the working directory back to UTF-8 */
 	if (git__utf16_to_8(buffer_out, size, cwd) < 0) {
 		DWORD code = GetLastError();
@@ -660,6 +662,7 @@ int p_getcwd(char *buffer_out, size_t size)
 		return -1;
 	}
 
+	git_path_mkposix(buffer_out);
 	return 0;
 }