aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/file_io.lua
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2019-01-31 13:16:18 -0500
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2019-01-31 13:16:18 -0500
commit422b18985b763758077c4e42b733b5a5ba100288 (patch)
tree179e6553f38bff64b1d8fbecc03cebe3e21ff3b7 /core/file_io.lua
parent86d03dc4dff7e3a86eb5b549f8cf9f94efce4275 (diff)
Do not limit version control markers to directories.
At least git allows files named '.git'.
Diffstat (limited to 'core/file_io.lua')
-rw-r--r--core/file_io.lua4
1 files changed, 1 insertions, 3 deletions
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