Skip to content

Commit

Permalink
Fix remove error on no branch repository
Browse files Browse the repository at this point in the history
  • Loading branch information
kmnk committed Jan 8, 2013
1 parent 762c394 commit 73eefb3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions autoload/giti/branch.vim
Expand Up @@ -22,19 +22,18 @@ endfunction"}}}

function! giti#branch#current_name()"{{{
let current_branch = giti#branch#current()
return type(current_branch) == type({})
\ ? current_branch['name']
\ : 'master'
return has_key(current_branch, 'name') ? current_branch['name'] : 'master'
endfunction"}}}

function! giti#branch#current()"{{{
return remove(filter(
let branchs = filter(
\ map(
\ split(giti#system('branch -a'), '\n'),
\ 's:build_branch_data(v:val)'
\ ),
\ 'v:val.is_current'
\ ), 0)
\ )
return len(branchs) > 0 ? remove(branches, 0) : {}
endfunction"}}}

function! giti#branch#delete(branches)"{{{
Expand Down

0 comments on commit 73eefb3

Please sign in to comment.