Skip to content

Commit 9d7d020

Browse files
benpeartdscho
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 3aa122f commit 9d7d020

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
@@ -218,7 +218,7 @@ int is_excluded_from_virtualfilesystem(const char *pathname, int pathlen, int dt
218218
if (dtype != DT_REG && dtype != DT_DIR && dtype != DT_LNK)
219219
die(_("is_excluded_from_virtualfilesystem passed unhandled dtype"));
220220

221-
if (dtype == DT_REG) {
221+
if (dtype == DT_REG || dtype == DT_LNK) {
222222
int ret = is_included_in_virtualfilesystem(pathname, pathlen);
223223
if (ret > 0)
224224
return 0;
@@ -227,7 +227,7 @@ int is_excluded_from_virtualfilesystem(const char *pathname, int pathlen, int dt
227227
return ret;
228228
}
229229

230-
if (dtype == DT_DIR || dtype == DT_LNK) {
230+
if (dtype == DT_DIR) {
231231
if (!parent_directory_hashmap.tablesize && virtual_filesystem_data.len)
232232
initialize_parent_directory_hashmap(&parent_directory_hashmap, &virtual_filesystem_data);
233233
if (!parent_directory_hashmap.tablesize)

0 commit comments

Comments
 (0)