Skip to content

Commit

Permalink
Work around reparse point stat issues
Browse files Browse the repository at this point in the history
In theory, p_stat should never return an S_ISLNK result, but due
to the current implementation on Windows with mount points it is
possible that it will.  For now, work around that by allowing a
link in the path to a directory being created.  If it is really a
problem, then the issue will be caught on the next iteration of
the loop, but typically this will be the right thing to do.
  • Loading branch information
arrbee committed Jun 24, 2013
1 parent 8294e8c commit 32c12ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/fileops.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ int git_futils_mkdir(
int tmp_errno = errno;

/* ignore error if directory already exists */
if (p_stat(make_path.ptr, &st) < 0 || !S_ISDIR(st.st_mode)) {
if (p_stat(make_path.ptr, &st) < 0 ||
!(S_ISDIR(st.st_mode) || S_ISLNK(st.st_mode))) {
errno = tmp_errno;
giterr_set(GITERR_OS, "Failed to make directory '%s'", make_path.ptr);
goto done;
Expand Down

0 comments on commit 32c12ea

Please sign in to comment.