From d1b47f1e87017d488237b1138780f1f6ad2f84ea Mon Sep 17 00:00:00 2001 From: Thierry Reding <treding@nvidia.com> Date: Mon, 31 Jul 2017 19:15:53 +0200 Subject: [PATCH] dim: Simplify test for current branch 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> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> --- dim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dim b/dim index ef7bc18..d525105 100755 --- a/dim +++ b/dim @@ -335,7 +335,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 -- GitLab