Skip to content

Commit 81f0bd5

Browse files
benpeartderrickstolee
authored andcommitted
virtualfilesystem: fix bug with symlinks being ignored
The virtual file system code incorrectly treated symlinks as directories instead of regular files. This meant symlinks were not included even if they are listed in the list of files returned by the core.virtualFilesystem hook proc. Fixes git-for-windows#25 Signed-off-by: Ben Peart <[email protected]>
1 parent d69bd0b commit 81f0bd5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

virtualfilesystem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ int is_excluded_from_virtualfilesystem(const char *pathname, int pathlen, int dt
222222
if (dtype != DT_REG && dtype != DT_DIR && dtype != DT_LNK)
223223
die(_("is_excluded_from_virtualfilesystem passed unhandled dtype"));
224224

225-
if (dtype == DT_REG) {
225+
if (dtype == DT_REG || dtype == DT_LNK) {
226226
int ret = is_included_in_virtualfilesystem(pathname, pathlen);
227227
if (ret > 0)
228228
return 0;
@@ -231,7 +231,7 @@ int is_excluded_from_virtualfilesystem(const char *pathname, int pathlen, int dt
231231
return ret;
232232
}
233233

234-
if (dtype == DT_DIR || dtype == DT_LNK) {
234+
if (dtype == DT_DIR) {
235235
if (!parent_directory_hashmap.tablesize && virtual_filesystem_data.len)
236236
initialize_parent_directory_hashmap(&parent_directory_hashmap, &virtual_filesystem_data);
237237
if (!parent_directory_hashmap.tablesize)

0 commit comments

Comments
 (0)