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
function git_checkout_match_generator(text, first, last) | |
found_matches = false; | |
if rl_state.line_buffer:find("^git checkout ") then | |
has_start_branch = not rl_state.line_buffer:find("^git checkout[ ]*$") | |
for line in io.popen("git branch 2>nul"):lines() do | |
local m = line:match("[%* ] (.+)$") | |
if m then | |
if not has_start_branch then | |
clink.add_match(m) |