From 6f5e1e3e4a108664ab65c7e4e8909fb22ccbfc37 Mon Sep 17 00:00:00 2001 From: Baris Acar Date: Mon, 10 Dec 2018 14:32:35 +0000 Subject: [PATCH] Makes cmder-powerline-prompt work with absolute gitdir paths, by testing the existence of the directories first. --- powerline_core.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/powerline_core.lua b/powerline_core.lua index f6affc7..2f60988 100644 --- a/powerline_core.lua +++ b/powerline_core.lua @@ -236,7 +236,10 @@ function get_git_dir(path) local git_dir = gitfile:read():match('gitdir: (.*)') gitfile:close() - return git_dir and dir..'/'..git_dir + -- gitdir can (apparently) be absolute or relative: + local file_when_absolute = git_dir and clink.is_dir(git_dir) and git_dir + local file_when_relative = git_dir and clink.is_dir(dir..'/'..git_dir) and dir..'/'..git_dir + return (file_when_absolute or file_when_relative) end -- Set default path to current directory