-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Absolute symlinks with root \ not supported #4586
Comments
@schletti2000 Thank you for this exemplary bug report. Thanks to the details, I was able to reproduce, to identify the responsible code and to come up with a patch. PR coming up shortly. |
When trying to ensure that long paths are handled correctly, we first normalize absolute paths when we encounter them. However, if the path was a so-called "drive-less" absolute path, i.e. if it was relative to the current drive but did start with a directory separator, we would want even the normalized output to be such a drive-less absolute path. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes git-for-windows#4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths when we encounter them. However, if the path was a so-called "drive-less" absolute path, i.e. if it was relative to the current drive but did start with a directory separator, we would want even the normalized output to be such a drive-less absolute path. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes git-for-windows#4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes git-for-windows#4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…hs intact (#4592) Git for Windows does not handle symbolic links correctly when their target is an absolute path without a drive prefix: a drive prefix is added. These type of paths, however, are completely legitimate on Windows, they are _kind of_ absolute paths, as they are still relative to the current directory's drive. So let's handle them as intended: by ensuring that targets that have no drive prefix _before_ normalization still don't have a drive prefix _after_ normalization. Oddly enough, the code that needs to be patched seems to have nothing to do with symbolic links, but all with long paths. Yet this is precisely the code path taken by `win32_create_symlink()` that adds that drive prefix (via normalization). The reason why only symbolic links seem to be affected is that this is the only usage where the resulting path is persisted instead of merely used in subsequent function calls. This fixes #4586.
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…hs intact (#4592) Git for Windows does not handle symbolic links correctly when their target is an absolute path without a drive prefix: a drive prefix is added. These type of paths, however, are completely legitimate on Windows, they are _kind of_ absolute paths, as they are still relative to the current directory's drive. So let's handle them as intended: by ensuring that targets that have no drive prefix _before_ normalization still don't have a drive prefix _after_ normalization. Oddly enough, the code that needs to be patched seems to have nothing to do with symbolic links, but all with long paths. Yet this is precisely the code path taken by `win32_create_symlink()` that adds that drive prefix (via normalization). The reason why only symbolic links seem to be affected is that this is the only usage where the resulting path is persisted instead of merely used in subsequent function calls. This fixes #4586.
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…hs intact (#4592) Git for Windows does not handle symbolic links correctly when their target is an absolute path without a drive prefix: a drive prefix is added. These type of paths, however, are completely legitimate on Windows, they are _kind of_ absolute paths, as they are still relative to the current directory's drive. So let's handle them as intended: by ensuring that targets that have no drive prefix _before_ normalization still don't have a drive prefix _after_ normalization. Oddly enough, the code that needs to be patched seems to have nothing to do with symbolic links, but all with long paths. Yet this is precisely the code path taken by `win32_create_symlink()` that adds that drive prefix (via normalization). The reason why only symbolic links seem to be affected is that this is the only usage where the resulting path is persisted instead of merely used in subsequent function calls. This fixes #4586.
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…hs intact (#4592) Git for Windows does not handle symbolic links correctly when their target is an absolute path without a drive prefix: a drive prefix is added. These type of paths, however, are completely legitimate on Windows, they are _kind of_ absolute paths, as they are still relative to the current directory's drive. So let's handle them as intended: by ensuring that targets that have no drive prefix _before_ normalization still don't have a drive prefix _after_ normalization. Oddly enough, the code that needs to be patched seems to have nothing to do with symbolic links, but all with long paths. Yet this is precisely the code path taken by `win32_create_symlink()` that adds that drive prefix (via normalization). The reason why only symbolic links seem to be affected is that this is the only usage where the resulting path is persisted instead of merely used in subsequent function calls. This fixes #4586.
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…hs intact (#4592) Git for Windows does not handle symbolic links correctly when their target is an absolute path without a drive prefix: a drive prefix is added. These type of paths, however, are completely legitimate on Windows, they are _kind of_ absolute paths, as they are still relative to the current directory's drive. So let's handle them as intended: by ensuring that targets that have no drive prefix _before_ normalization still don't have a drive prefix _after_ normalization. Oddly enough, the code that needs to be patched seems to have nothing to do with symbolic links, but all with long paths. Yet this is precisely the code path taken by `win32_create_symlink()` that adds that drive prefix (via normalization). The reason why only symbolic links seem to be affected is that this is the only usage where the resulting path is persisted instead of merely used in subsequent function calls. This fixes #4586.
@schletti2000 you can install the latest snapshot to get the fix before the next official Git for Windows release. |
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…hs intact (#4592) Git for Windows does not handle symbolic links correctly when their target is an absolute path without a drive prefix: a drive prefix is added. These type of paths, however, are completely legitimate on Windows, they are _kind of_ absolute paths, as they are still relative to the current directory's drive. So let's handle them as intended: by ensuring that targets that have no drive prefix _before_ normalization still don't have a drive prefix _after_ normalization. Oddly enough, the code that needs to be patched seems to have nothing to do with symbolic links, but all with long paths. Yet this is precisely the code path taken by `win32_create_symlink()` that adds that drive prefix (via normalization). The reason why only symbolic links seem to be affected is that this is the only usage where the resulting path is persisted instead of merely used in subsequent function calls. This fixes #4586.
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…hs intact (#4592) Git for Windows does not handle symbolic links correctly when their target is an absolute path without a drive prefix: a drive prefix is added. These type of paths, however, are completely legitimate on Windows, they are _kind of_ absolute paths, as they are still relative to the current directory's drive. So let's handle them as intended: by ensuring that targets that have no drive prefix _before_ normalization still don't have a drive prefix _after_ normalization. Oddly enough, the code that needs to be patched seems to have nothing to do with symbolic links, but all with long paths. Yet this is precisely the code path taken by `win32_create_symlink()` that adds that drive prefix (via normalization). The reason why only symbolic links seem to be affected is that this is the only usage where the resulting path is persisted instead of merely used in subsequent function calls. This fixes #4586.
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…hs intact (#4592) Git for Windows does not handle symbolic links correctly when their target is an absolute path without a drive prefix: a drive prefix is added. These type of paths, however, are completely legitimate on Windows, they are _kind of_ absolute paths, as they are still relative to the current directory's drive. So let's handle them as intended: by ensuring that targets that have no drive prefix _before_ normalization still don't have a drive prefix _after_ normalization. Oddly enough, the code that needs to be patched seems to have nothing to do with symbolic links, but all with long paths. Yet this is precisely the code path taken by `win32_create_symlink()` that adds that drive prefix (via normalization). The reason why only symbolic links seem to be affected is that this is the only usage where the resulting path is persisted instead of merely used in subsequent function calls. This fixes #4586.
Thank you for the quick fix! I installed the snapshot release and it fixes the problem. I am now able to recover with the standard commands like restore, reset etc. from a broken repository state ( git status show absolute driveless symlink as changed). Couldn't find the issue mentioned in the shipped release notes but I assume thats because of this being a snapshot build? |
Hah. More likely because I forgot to mention it ;-) Thank you for pointing this out! |
/add release note bug Symbolic links whose target is an absolute path without the drive prefix accidentally had a drive prefix added when checked out, rendering them "eternally modified". This bug has been fixed. The workflow run was started |
Symbolic links whose target is an absolute path _without_ the drive prefix [accidentally had a drive prefix added when checked out](git-for-windows/git#4586), rendering them "eternally modified". This bug [has been fixed](git-for-windows/git#4592). Signed-off-by: gitforwindowshelper[bot] <gitforwindowshelper-bot@users.noreply.github.com>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes git-for-windows#4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When trying to ensure that long paths are handled correctly, we first normalize absolute paths as we encounter them. However, if the path is a so-called "drive-less" absolute path, i.e. if it is relative to the current drive but _does_ start with a directory separator, we would want the normalized path to be such a drive-less absolute path, too. Let's do that, being careful to still include the drive prefix when we need to go through the `\\?\` dance (because there, the drive prefix is absolutely required). This fixes #4586. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Setup
to the issue you're seeing?
** Windows developer mode on, symlink creation policy enabled **
Details
cmd,git bash
Minimal, Complete, and Verifiable example
this will help us understand the issue.
I am creating an absolute symlink to root (e.g. \opt\v1.0 - /opt/v1.0 in the database). The symlink should work both on windows and linux platforms
When switching back to main, git sees a change from the worktree to the index:
However, an absolute symlink only containing \ (or / in the database) does work. So the workaround currently is to create this intermediary symlink root symlink:
UPDATE: Of course this doesn't work well. The root symlink causes recursion for some processes which are not guarded against loops (see https://unix.stackexchange.com/a/277170/346937)
The root symlink ist left alone by git as [\] (and not updated as [C:\]). mkdir /d can create \opt\v1.0 symlinks without problems (doesnt make sense, but its for cross platform dev and linux can use symlinks like this)
URL to that repository to help us with testing?
The text was updated successfully, but these errors were encountered: