mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-22 08:00:07 +00:00
Merge pull request #1680 from csware/win32-junction
Correctly handle win32 junctions
This commit is contained in:
commit
22ef0c2857
@ -350,8 +350,7 @@ int git_futils_mkdir(
|
|||||||
int tmp_errno = errno;
|
int tmp_errno = errno;
|
||||||
|
|
||||||
/* ignore error if directory already exists */
|
/* ignore error if directory already exists */
|
||||||
if (p_stat(make_path.ptr, &st) < 0 ||
|
if (p_stat(make_path.ptr, &st) < 0 || !S_ISDIR(st.st_mode)) {
|
||||||
!(S_ISDIR(st.st_mode) || S_ISLNK(st.st_mode))) {
|
|
||||||
errno = tmp_errno;
|
errno = tmp_errno;
|
||||||
giterr_set(GITERR_OS, "Failed to make directory '%s'", make_path.ptr);
|
giterr_set(GITERR_OS, "Failed to make directory '%s'", make_path.ptr);
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -90,6 +90,9 @@ static int do_lstat(
|
|||||||
if (fdata.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
|
if (fdata.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
|
||||||
fMode |= S_IFLNK;
|
fMode |= S_IFLNK;
|
||||||
|
|
||||||
|
if ((fMode & (S_IFDIR | S_IFLNK)) == (S_IFDIR | S_IFLNK)) // junction
|
||||||
|
fMode ^= S_IFLNK;
|
||||||
|
|
||||||
buf->st_ino = 0;
|
buf->st_ino = 0;
|
||||||
buf->st_gid = 0;
|
buf->st_gid = 0;
|
||||||
buf->st_uid = 0;
|
buf->st_uid = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user