From: Thierry Reding treding@nvidia.com
Instead of listing branches and grepping for the current branch, simply read the name of the current branch and compare.
Suggested-by: Daniel Vetter daniel.vetter@intel.com Signed-off-by: Thierry Reding treding@nvidia.com --- dim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dim b/dim index 1422b35e2471..ebb1da05662d 100755 --- a/dim +++ b/dim @@ -333,7 +333,7 @@ function git_current_branch
function git_is_current_branch # branch { - git branch --list $1 | grep -q '*' + test "$(git_current_branch)" = "$1" }
function git_branch_exists # branch