rhysd / committia.vim

A Vim plugin for more pleasant editing on commit messages
MIT License
731 stars 30 forks source link

Shown strange status with git worktree #27

Closed thinca closed 7 years ago

thinca commented 8 years ago

Consider the following situation.

$ mkdir tmp
$ cd tmp
$ git init base
Initialized empty Git repository in /home/thinca/tmp/base/.git/

$ cd base
$ touch README.md
$ git add README.md
$ git commit -m init
[master (root-commit) 6e8b9c5] init
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 README.md

$ git worktree add ../sub
Preparing ../sub (identifier sub)
HEAD is now at 6e8b9c5 init

$ cd ../sub
$ touch new.vim
$ git add new.vim
$ git commit

committia.vim shows the following in status window.

# On branch sub
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       new file:   new.vim
#
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       deleted:    README.md
#       deleted:    new.vim
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       sub/
#

This is strange. I want to use committia.vim with git worktree.

rhysd commented 8 years ago

Thank you for the report. commitia.vim currently doesn't consider git worktree.

thinca commented 7 years ago

Thanks! 😄