MSYS2-packages/msys2-runtime-3.5/0045-fixup-Add-functionality-for-converting-UNIX-paths-in.patch
Johannes Schindelin 96ef9fc317 msys2-runtime-3.5: branch off of msys2-runtime
Cygwin v3.5.0 has been released end of January 2024, and we were _about_
to be on the brink to switch to MSYS2 runtime based on the Cygwin
runtime v3.5.x.

However:

- That would leave Windows 7/8 compatibility behind.
- There have been a couple of hiccups in our testing, which led us to
  skip v3.5.0 already.
- We determined that a safer way would be to let users opt into using
  v3.5.x first, kicking the tires, so to say.

So let's establish a `msys2-runtime-3.5` package (much like
`msys2-runtime-3.3`) to be able to easily revert to a known state really
quickly, including the ability to run on Windows 7.

For now, this is merely a verbatim copy of the files in `msys2-runtime`,
and the next commits will modify them to reflect the version bump.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-03-10 00:02:00 +01:00

63 lines
2.5 KiB
Diff

From 9944652c41fb96f555d221865f4ed5d0c8b33514 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Wed, 18 Feb 2015 11:07:17 +0000
Subject: [PATCH 45/N] fixup! Add functionality for converting UNIX paths in
arguments and environment variables to Windows form for native Win32
applications.
With this commit, the POSIX-to-Windows conversion also leaves Git's
`<rev>:./<name>` syntax alone. Such a string would otherwise be mistaken
for indicating a path list, but path lists are expected to contain only
absolute paths, which would not be the case here.
This addresses the expectations of the following test cases in the test
suite of https://github.com/git/git/tree/v2.43.0:
-t1506.4 correct relative file objects (1)
-t1506.5 correct relative file objects (2)
-t1506.6 correct relative file objects (3)
-t1506.7 correct relative file objects (4)
-t1506.14 relative path not found
-t1506.15 relative path outside worktree
-t1506.16 relative path when cwd is outside worktree
-t1513.5 empty prefix HEAD:./path
-t1513.6 valid prefix HEAD:./path
-t1513.7 valid prefix HEAD:../path
-t2070.4 restore a file on worktree from another ref
-t2070.5 restore a file in the index from another ref
-t2070.6 restore a file in both the index and worktree from another ref
-t2070.8 restore --worktree --staged uses HEAD as source
-t7900.33 start and stop macOS maintenance
-t7900.34 use launchctl list to prevent extra work
-t7900.35 start and stop Windows maintenance
-t7900.36 start and stop Linux/systemd maintenance
-t7900.37 start and stop when several schedulers are available
-t9300.195 Y: rewrite submodules
-t9304.6 import with submodule mapping
-t9304.7 paths adjusted for relative subdir
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
winsup/cygwin/msys2_path_conv.cc | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/winsup/cygwin/msys2_path_conv.cc b/winsup/cygwin/msys2_path_conv.cc
index 71c4735..0ac47f0 100644
--- a/winsup/cygwin/msys2_path_conv.cc
+++ b/winsup/cygwin/msys2_path_conv.cc
@@ -380,6 +380,14 @@ skip_p2w:
// Avoid mangling IPv6 addresses
if (it + 1 < end && it[1] == ':')
goto skip_p2w;
+
+ // Leave Git's <rev>:./name syntax alone
+ if (it + 1 < end && it[1] == '.') {
+ if (it + 2 < end && it[2] == '/')
+ goto skip_p2w;
+ if (it + 3 < end && it[2] == '.' && it[3] == '/')
+ goto skip_p2w;
+ }
break;
}
++it;