Closed ichizok closed 8 years ago
Confirmed thanks! https://github.com/lambdalisue/vim-gita/commit/14b6174e32a11b9f74995e6b744cc7dcfe71c8c7 would fix this
Thank you for fix quickly :+1:
There is a case main repository has remote branch.
$ git clone https://github.com/lambdalisue/vim-gita
$ cd vim-gita
$ git worktree add -b develop ../vim-gita_develop origin/develop
$ cd ../vim-gita_develop
$ vim
:Gita status
status of vim-gita_develop/develop | Press ? to show help or <Tab> to select action
missing remote.
desirable:
:Gita status
status of vim-gita_develop/develop <> origin/develop | Press ? to show help or <Tab> to select action
Thanks. Hum... it seems the implementation requires to be a bit tricky.
<repository>/worktree-test/.git
becomes a file and the content is
gitdir: <root>/vim-gita/.git/worktrees/worktree-test
And vim-gita/.git
directory contains
- .git/
|+ branches/
|+ hooks/
|+ info/
|+ logs/
|+ objects/
|+ refs/
|- worktrees/
|- worktree-test/
|- logs/
| HEAD
| HEAD
| commondir
| gitdir
| gitfile
| index
| COMMIT_EDITMSG
| FETCH_HEAD
| HEAD
| ORIG_HEAD
| config
| description
| index
| packed-refs
So try to read files from worktrees/worktree-test
first and then a directory written in commondir
.
Give me time to implement this.
Summary (required)
On git-worktree repository,
Gita commit
andGita status
cause error.Behavior (required)
Minimal vimrc (required)
Procedure (required)
Environment
Write your environment informations as many as possible.
Remarks
On git-worktree repository,
s:GitInfo.get_remote_branch()
returns{ 'name': '', 'hash': '', 'url': '' }
, lack ofremote
key.https://github.com/lambdalisue/vim-gita/blob/master/autoload/vital/__gita__/Git/Info.vim#L228 https://github.com/lambdalisue/vim-gita/blob/master/autoload/gita/statusline.vim#L238
here checking
remote.remote
directly, thus, causes error.https://github.com/lambdalisue/vim-gita/blob/master/autoload/gita/content/commit.vim#L99