Skip to content

Conversation

dscho
Copy link
Member

@dscho dscho commented Jan 1, 2020

This fixes the remaining part of #1676, where working inside a Git worktree inside a symlinked directory would not work.

As pointed out in git-for-windows#1676,
the `git rev-parse --is-inside-work-tree` command currently fails when
the current directory's path contains symbolic links.

The underlying reason for this bug is that `getcwd()` is supposed to
resolve symbolic links, but our `mingw_getcwd()` implementation did not.

We do have all the building blocks for that, though: the
`GetFinalPathByHandleW()` function will resolve symbolic links. However,
we only called that function if `GetLongPathNameW()` failed, for
historical reasons: the latter function was supported for a long time,
but the former API function was introduced only with Windows Vista, and
we used to support also Windows XP. With that support having been
dropped, we are free to call the symbolic link-resolving function right
away.

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho added this to the Next release milestone Jan 3, 2020
@dscho dscho merged commit 0c54f76 into git-for-windows:master Jan 3, 2020
dscho added a commit to dscho/git that referenced this pull request Jan 3, 2020
…ymlinks

Do resolve symlinks in `getcwd()`
dscho added a commit to git-for-windows/build-extra that referenced this pull request Jan 3, 2020
Git [now works
properly](git-for-windows/git#2449) when
inside a symlinked work tree.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this pull request Jan 4, 2020
dscho added a commit that referenced this pull request Jan 4, 2020
dscho added a commit that referenced this pull request Jan 4, 2020
git-for-windows-ci pushed a commit that referenced this pull request Jan 6, 2020
git-for-windows-ci pushed a commit that referenced this pull request Jan 7, 2020
git-for-windows-ci pushed a commit that referenced this pull request Jan 7, 2020
git-for-windows-ci pushed a commit that referenced this pull request Jan 8, 2020
git-for-windows-ci pushed a commit that referenced this pull request Jan 8, 2020
git-for-windows-ci pushed a commit that referenced this pull request Jan 8, 2020
dscho added a commit to dscho/git that referenced this pull request Jan 9, 2020
…ymlinks

Do resolve symlinks in `getcwd()`
git-for-windows-ci pushed a commit that referenced this pull request Jan 9, 2020
dscho added a commit that referenced this pull request Jan 9, 2020
git-for-windows-ci pushed a commit that referenced this pull request Aug 25, 2025
git-for-windows-ci pushed a commit that referenced this pull request Aug 27, 2025
git-for-windows-ci pushed a commit that referenced this pull request Aug 28, 2025
git-for-windows-ci pushed a commit that referenced this pull request Aug 28, 2025
git-for-windows-ci pushed a commit that referenced this pull request Aug 29, 2025
git-for-windows-ci pushed a commit that referenced this pull request Aug 29, 2025
dscho added a commit that referenced this pull request Aug 30, 2025
dscho added a commit that referenced this pull request Aug 30, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 2, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 2, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 2, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 2, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 3, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 4, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 4, 2025
dscho added a commit that referenced this pull request Sep 8, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 8, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 9, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 9, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 10, 2025
dscho added a commit that referenced this pull request Sep 11, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 11, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 12, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 15, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 16, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 16, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 17, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 17, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 18, 2025
git-for-windows-ci pushed a commit that referenced this pull request Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant