tpope/vim-fugitive — Issue #155: :Gcommit only works once when .git is a symlink
Author: sjl
Created: 2012-02-13 15:18:37+00:00
State: open

I've got a repo at `~/foo/`. It's `.git` directory is a symlink pointing at `~/bar`.

I can use fugitive with this repo without much of a problem until I successfully perform a commit with `:Gcommit` once. Once that happens any further attempts to commit with fugitive (by running `:Gcommit`, creating a message and `:wq`'ing the commit message buffer) will fail with the following error:

"~/bar/COMMIT_EDITMSG" 9L, 271C written

Error detected while processing function 34_FinishCommit..34_Commit:
line 7:
E344: Can't find directory "`=s:repo().tree()`" in cdpath
E472: Command failed
Error detected while processing function 34_FinishCommit:
line 4:
E171: Missing :endif

I can restart Vim and get another commit out of fugitive, but that gets tedious when making a lot of commits.

However, the following *does* work:

1. Open Vim.
2. Edit some files.
3. Use `:Gwrite` to push the edits into the index.
4. Use `git commit` in the shell *outside* of Vim to commit.
5. Repeat steps 2-4 as many times as desired.
6. Commit once through fugitive.

In other words: committing outside of fugitive doesn't break fugitive's committing.

If there's anything I can do to help fix this let me know. If you tell me the general area where I should be looking I can poke around and try to figure out what's going on.