Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
c6e26210
Commit
c6e26210
authored
Oct 13, 2014
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2615 from ethomson/mount_points
Mount points
parents
c0c8570c
969b6a47
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
3 deletions
+24
-3
src/path.c
+12
-2
src/win32/posix_w32.c
+12
-1
No files found.
src/path.c
View file @
c6e26210
...
...
@@ -515,8 +515,19 @@ bool git_path_is_empty_dir(const char *path)
WIN32_FIND_DATAW
findData
;
HANDLE
hFind
=
FindFirstFileW
(
filter_w
,
&
findData
);
/* FindFirstFile will fail if there are no children to the given
* path, which can happen if the given path is a file (and obviously
* has no children) or if the given path is an empty mount point.
* (Most directories have at least directory entries '.' and '..',
* but ridiculously another volume mounted in another drive letter's
* path space do not, and thus have nothing to enumerate.) If
* FindFirstFile fails, check if this is a directory-like thing
* (a mount point).
*/
if
(
hFind
==
INVALID_HANDLE_VALUE
)
return
git_path_isdir
(
path
);
/* If the find handle was created successfully, then it's a directory */
if
(
hFind
!=
INVALID_HANDLE_VALUE
)
{
empty
=
true
;
do
{
...
...
@@ -532,7 +543,6 @@ bool git_path_is_empty_dir(const char *path)
FindClose
(
hFind
);
}
}
return
empty
;
}
...
...
src/win32/posix_w32.c
View file @
c6e26210
...
...
@@ -131,6 +131,11 @@ GIT_INLINE(time_t) filetime_to_time_t(const FILETIME *ft)
return
(
time_t
)
winTime
;
}
static
bool
path_is_volume
(
wchar_t
*
target
,
size_t
target_len
)
{
return
(
target_len
&&
wcsncmp
(
target
,
L"
\\
??
\\
Volume{"
,
11
)
==
0
);
}
/* On success, returns the length, in characters, of the path stored in dest.
* On failure, returns a negative value. */
static
int
readlink_w
(
...
...
@@ -177,7 +182,13 @@ static int readlink_w(
goto
on_error
;
}
if
(
target_len
)
{
if
(
path_is_volume
(
target
,
target_len
))
{
/* This path is a reparse point that represents another volume mounted
* at this location, it is not a symbolic link our input was canonical.
*/
errno
=
EINVAL
;
error
=
-
1
;
}
else
if
(
target_len
)
{
/* The path may need to have a prefix removed. */
target_len
=
git_win32__canonicalize_path
(
target
,
target_len
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment