This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
-- Find out current branch | |
-- @return {false|git branch name} | |
--- | |
function get_git_branch() | |
for line in io.popen("git branch 2>nul"):lines() do | |
local m = line:match("%* (.+)$") | |
if m then | |
return m | |
end |