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

[bugfix] fix wsl mode bits error in subdir #4660

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

swigger
Copy link

@swigger swigger commented Oct 27, 2023

Support for wsl mode bits was previously added to git, but there was a bug because the filenames provided by fscache did not contain paths.

This commit fixes the issue.

The previous feature is added in PR #4438,
but at that time I didn't tested so much.
Sorry to have this bug.

To test this feature, set core.wslcompat to ture and core.filemode to true and make sure repo is on NTFS.

@swigger
Copy link
Author

swigger commented Oct 27, 2023

Please ignore the 2 ci errors, it seems they are not related with the modified code

memcpy(buf + off, fse->dirent.d_name, fse->len);
buf[off + fse->len] = '\0';
if (xutftowcs_long_path(wpath, buf) >= 0)
copy_wsl_mode_bits_from_disk(wpath, -1, &fse->st_mode);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix wsl mode bits bug in subdir

Support for wsl mode bits was previously added to git,
but there was a bug because the filenames provided by
fscache did not contain paths.

This commit fixes the issue.

I am sorry, but this commit message does nothing at all to help me to understand while the previous fdata->FileName would not be enough.

Please review https://github.blog/2022-06-30-write-better-commits-build-better-projects/ and improve the commit message accordingly.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, now commit updated.

Ex: fdata->FileName is only foo.sh while we need path/to/foo.sh to open the file.

Support for wsl mode bits was previously added to git,
but there was a bug because the filenames provided by
fdata did not contain paths. Ex: fdata->FileName is only
foo.sh while we need path/to/foo.sh to open the file.

This commit fixes the issue.

Signed-off-by: lixungeng <xungeng@gmail.com>
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.

None yet

2 participants