Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b283a08

Browse files
committed
support submodule (fix #2)
1 parent 9ee31bf commit b283a08

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎autoload/gitbranch.vim

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
" Filename: autoload/gitbranch.vim
33
" Author: itchyny
44
" License: MIT License
5-
" Last Change: 2015/02/01 23:49:33.
5+
" Last Change: 2015/02/20 21:00:53.
66
" =============================================================================
77

88
let s:save_cpo = &cpo
@@ -31,6 +31,11 @@ function! gitbranch#dir(path) abort
3131
let type = getftype(dir)
3232
if type ==# 'dir' && isdirectory(dir.'/objects') && isdirectory(dir.'/refs') && getfsize(dir.'/HEAD') > 10
3333
return dir
34+
elseif type ==# 'file'
35+
let reldir = get(readfile(dir), 0, '')
36+
if reldir =~# '^gitdir: '
37+
return simplify(path . '/' . reldir[8:])
38+
endif
3439
endif
3540
let prev = path
3641
let path = fnamemodify(path, ':h')

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /