Permalink
Browse files

Fix SEGV on no branch repository

  • Loading branch information...
1 parent 91b2ae5 commit 762c394a9353b85296f14fec752698c52125d677 @kmnk committed Jan 8, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 autoload/giti/branch.vim
View
@@ -21,7 +21,10 @@ function! giti#branch#list_all()"{{{
endfunction"}}}
function! giti#branch#current_name()"{{{
- return giti#branch#current()['name']
+ let current_branch = giti#branch#current()
+ return type(current_branch) == type({})
+\ ? current_branch['name']
+\ : 'master'
endfunction"}}}
function! giti#branch#current()"{{{

0 comments on commit 762c394

Please sign in to comment.