Permalink
Browse files

Refactory of #hg_current_branch in mercurial plugin

  • Loading branch information...
1 parent 7163095 commit 5ec68ff511f9e63704b5dd627628cd729415bdaf @lucassmagal committed Oct 8, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 plugins/mercurial/mercurial.plugin.zsh
@@ -14,9 +14,8 @@ alias hgs='hg status'
alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
function hg_current_branch() {
- if [ -d .hg ]; then
- echo $(hg branch)
- fi
+ local ref=$(hg branch 2>/dev/null) || return
+ echo $ref
}
function parse_hg_dirty() {

0 comments on commit 5ec68ff

Please sign in to comment.