ohmyzsh: Git checkout branch-name tab completion does not work on a dirty repository

If you have a dirty repository (ie a file has been edited) tab completion no longer works for git checkout’s branch name. Full reproduction steps:

mkdir git_checkout_tab_completion
cd git_checkout_tab_completion
git init
touch README
git add README
git commit -m "README"
git branch topic/foo
# this works and sets the command line to "git checkout topic/foo"
git checkout topic/<tab>
git checkout master
echo "a" >README
# this one resets the command line back to "git checkout topic"
git checkout topic/<tab>

The Ctrl+x ? completion debug is here

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments