Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim-fugitiveを入れた状態でseparate-git-dirなリポジトリの未コミット差分が見えない #48

Open
portown opened this issue May 28, 2015 · 4 comments

Comments

@portown
Copy link

portown commented May 28, 2015

git clone時に--separate-git-dir=...オプションを使用して作業ツリーを分離したリポジトリをagit.vimで見た際、
未コミット差分が "fatal: This operation must be run in a work tree" とエラーになります。

agit.vimの他にvim-fugitiveが入っていると現象が発生し、
agit.vim単独では発生しません。

@portown
Copy link
Author

portown commented Jul 2, 2015

リポジトリパスの取得方法にfugitive.vimの有無で差異があるようです。

以下のような状況を仮定します。
リポジトリ:/foo/repos.git/
作業ツリー:/bar/work/

このとき、リポジトリの場所が以下のように判定されます。
fugitive.vimなし:/bar/work/.git/ (誤ったリポジトリパス)
fugitive.vimあり:/foo/repos.git/ (正しいリポジトリパス)

未コミット差分を見る際、「作業ツリー=リポジトリの親ディレクトリ」としているので、
作業ツリーの場所が以下のようになります。
fugitive.vimなし:/bar/work/ (正しい作業ツリールートパス)
fugitive.vimあり:/foo/ (誤った作業ツリールートパス)

fugitive.vimありの場合、最終的に取得できる作業ツリーの場所が誤っているため、
未コミット差分が見えなくなっているようです。

リポジトリの場所、作業ツリーの場所、
それぞれの取得方法の修正が必要かと思います。

@cohama
Copy link
Owner

cohama commented Jul 8, 2015

報告ありがとうございます&対応遅くなりすみません。
ひとまず教えていただいた情報を元に修正を試みます。

@cohama
Copy link
Owner

cohama commented Jul 8, 2015

ちなみにですが、Git のバージョンを教えていただいても良いでしょうか?

@portown
Copy link
Author

portown commented Jul 10, 2015

Mac OS XのHomeBrewで入れたGit 2.4.5です。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants