You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.git directory is created and initialized.
However, a temporary .git2_abcdef symlink is created in the working directory but not automatically deleted.
Expected behavior
symlink automatically deleted by libgit2.
Actual behavior
symlink not deleted.
Version of libgit2 (release number or SHA1)
v0.28.0-232-ge50d138
Operating system(s) tested
Windows 10 Pro 1809
Cause
In repository.c are_symlinks_supported(),
Create a temp file .git2_abcdef where abcdef is random
Delete that temp file
Create a symlink .git2_abcdef that points to testing. However the file testing does not exist.
If target does not exist, CreateSymbolicLinkW() will create the symlink as directory type, even do not specify SYMBOLIC_LINK_FLAG_DIRECTORY
Check if .git2_abcdef is a symlink
Delete .git2_abcdef using DeleteFileW(). If symlink type becomes directory, DeleteFileW() does not work. Here is the problem why the symlink is left!!!
Solutions
A. To test symlink, point to a file that exists, instead of that testing.
Create 2 temporary files, one is symlink that points to the other file. Then delete these 2 files.
B. Use RemoveDirectoryW() as fallback
The text was updated successfully, but these errors were encountered:
Reproduction steps
core.symlinks true
C:\123
, this will be used as repository root..git
directory is created and initialized.However, a temporary
.git2_abcdef
symlink is created in the working directory but not automatically deleted.Expected behavior
symlink automatically deleted by libgit2.
Actual behavior
symlink not deleted.
Version of libgit2 (release number or SHA1)
v0.28.0-232-ge50d138
Operating system(s) tested
Windows 10 Pro 1809
Cause
In repository.c
are_symlinks_supported()
,.git2_abcdef
whereabcdef
is random.git2_abcdef
that points totesting
. However the filetesting
does not exist.If target does not exist,
CreateSymbolicLinkW()
will create the symlink as directory type, even do not specifySYMBOLIC_LINK_FLAG_DIRECTORY
.git2_abcdef
is a symlink.git2_abcdef
usingDeleteFileW()
. If symlink type becomes directory,DeleteFileW()
does not work. Here is the problem why the symlink is left!!!Solutions
A. To test symlink, point to a file that exists, instead of that
testing
.Create 2 temporary files, one is symlink that points to the other file. Then delete these 2 files.
B. Use
RemoveDirectoryW()
as fallbackThe text was updated successfully, but these errors were encountered: