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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Thierry Reding <treding@xxxxxxxxxx>

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@xxxxxxxxx>
Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
---
 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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux