Skip to content
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

Do resolve symlinks in getcwd() #2449

Merged
merged 1 commit into from
Jan 3, 2020

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 Feb 15, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 15, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 19, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 19, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 20, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 21, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 21, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 22, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 24, 2025
dscho added a commit that referenced this pull request Feb 25, 2025
dscho added a commit that referenced this pull request Feb 25, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 25, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 25, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 25, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 26, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 26, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 26, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 26, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 26, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 26, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 26, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 26, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 26, 2025
dscho added a commit to dscho/git that referenced this pull request Feb 26, 2025
…ymlinks

Do resolve symlinks in `getcwd()`
git-for-windows-ci pushed a commit that referenced this pull request Feb 26, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 26, 2025
dscho added a commit that referenced this pull request Feb 26, 2025
dscho added a commit that referenced this pull request Feb 27, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 28, 2025
git-for-windows-ci pushed a commit that referenced this pull request Feb 28, 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