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 <johannes.schindelin@gmx.de>
@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 <johannes.schindelin@gmx.de>
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
dscho added a commit that referenced this pull request Oct 20, 2024
dscho added a commit that referenced this pull request Oct 20, 2024
dscho added a commit that referenced this pull request Oct 21, 2024
git-for-windows-ci pushed a commit that referenced this pull request Oct 21, 2024
git-for-windows-ci pushed a commit that referenced this pull request Oct 21, 2024
git-for-windows-ci pushed a commit that referenced this pull request Oct 22, 2024
git-for-windows-ci pushed a commit that referenced this pull request Oct 22, 2024
git-for-windows-ci pushed a commit that referenced this pull request Oct 22, 2024
git-for-windows-ci pushed a commit that referenced this pull request Oct 22, 2024
git-for-windows-ci pushed a commit that referenced this pull request Oct 22, 2024
git-for-windows-ci pushed a commit that referenced this pull request Oct 22, 2024
dscho added a commit that referenced this pull request Oct 23, 2024
git-for-windows-ci pushed a commit that referenced this pull request Oct 25, 2024
git-for-windows-ci pushed a commit that referenced this pull request Oct 25, 2024
git-for-windows-ci pushed a commit that referenced this pull request Oct 25, 2024
git-for-windows-ci pushed a commit that referenced this pull request Oct 30, 2024
git-for-windows-ci pushed a commit that referenced this pull request Nov 1, 2024
git-for-windows-ci pushed a commit that referenced this pull request Nov 6, 2024
dscho added a commit to dscho/git that referenced this pull request Nov 12, 2024
…ymlinks

Do resolve symlinks in `getcwd()`
dscho added a commit that referenced this pull request Nov 22, 2024
dscho added a commit that referenced this pull request Nov 22, 2024
dscho added a commit that referenced this pull request Nov 22, 2024
dscho added a commit that referenced this pull request Nov 22, 2024
dscho added a commit that referenced this pull request Nov 22, 2024
git-for-windows-ci pushed a commit that referenced this pull request Nov 25, 2024
git-for-windows-ci pushed a commit that referenced this pull request Nov 25, 2024
git-for-windows-ci pushed a commit that referenced this pull request Nov 25, 2024
git-for-windows-ci pushed a commit that referenced this pull request Nov 25, 2024
dscho added a commit to dscho/git that referenced this pull request Nov 25, 2024
…ymlinks

Do resolve symlinks in `getcwd()`
git-for-windows-ci pushed a commit that referenced this pull request Nov 25, 2024
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