Skip to content

Commit 4a30334

Browse files
committed
Fix plumbing in .git/ repo dirs
The special handling of the context did only work for files in subdirectories (e.g. rebase scripts) but not for files directly inside it (e.g. commit msgs).
1 parent 1b7f975 commit 4a30334

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

plugin/acme.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,14 +543,14 @@ function s:CtxDir()
543543
let dir = isdirectory(d) ? d : dir
544544
endif
545545
endif
546-
if dir =~ '/\.git/'
546+
if dir =~ '\v/\.git(/|$)'
547547
let owd = chdir(dir)
548548
let d = trim(system('git rev-parse --show-toplevel'), "\r\n")
549549
if owd != ''
550550
call chdir(owd)
551551
endif
552552
if !isdirectory(d)
553-
let d = substitute(dir, '/\.git/.*', '', '')
553+
let d = substitute(dir, '\v/\.git(/.*)?', '', '')
554554
endif
555555
let dir = d
556556
endif

0 commit comments

Comments
 (0)