From 422b18985b763758077c4e42b733b5a5ba100288 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 31 Jan 2019 13:16:18 -0500 Subject: Do not limit version control markers to directories. At least git allows files named '.git'. --- core/file_io.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'core') diff --git a/core/file_io.lua b/core/file_io.lua index d976d84a..820bf70a 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -362,9 +362,7 @@ function io.get_project_root(path) local dir = path or (buffer.filename or lfs.currentdir()):match('^(.+)[/\\]') while dir do for i = 1, #vcs do - if lfs_attributes(dir..'/'..vcs[i], 'mode') == 'directory' then - return dir - end + if lfs_attributes(dir..'/'..vcs[i], 'mode') then return dir end end dir = dir:match('^(.+)[/\\]') end -- cgit v1.2.3