Skip to content

Commit

Permalink
Makes cmder-powerline-prompt work with absolute gitdir paths, by test…
Browse files Browse the repository at this point in the history
…ing the existence of the directories first.
  • Loading branch information
bacar committed Dec 10, 2018
1 parent ed55c95 commit 6f5e1e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion powerline_core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f5e1e3

Please sign in to comment.