Skip to content

Commit ea94df0

Browse files
committed
Fix: readlink() not returning target symlink when it is desired
Core api command readlink() was depending on a git configuration specific setting of has_symlinks to decide whether it should attempt to return the target of a symlink. It should be up to the caller to check whether symlinks are enabled not up to the api command readlink(). If a caller wants to get a symlink target, then it should get it regardless of whether symlinks are configured in git's core.symlinks setting. Signed-off-by: Rick Burgstaler <[email protected]>
1 parent 06d0ace commit ea94df0

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

compat/mingw.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2322,12 +2322,6 @@ int readlink(const char *path, char *buf, size_t bufsiz)
23222322
char tmpbuf[MAX_LONG_PATH];
23232323
int len;
23242324

2325-
/* fail if symlinks are disabled */
2326-
if (!has_symlinks) {
2327-
errno = ENOSYS;
2328-
return -1;
2329-
}
2330-
23312325
if (xutftowcs_long_path(wpath, path) < 0)
23322326
return -1;
23332327

0 commit comments

Comments
 (0)