[maintainer-tools PATCH 2/2] dim: Simplify test for current branch

Thierry Reding thierry.reding at gmail.com
Mon Jul 31 17:15:53 UTC 2017


From: Thierry Reding <treding at 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 at intel.com>
Signed-off-by: Thierry Reding <treding at 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
-- 
2.13.3



More information about the dri-devel mailing list