From 2104dc69c704278ed4614fe4473219c896609110 Mon Sep 17 00:00:00 2001
From: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Tue, 21 Mar 2017 13:44:11 +0100
Subject: [PATCH] dim: really make the branch argument for dim retip optional

The shift did eat fail (or eat the arguments), resulting in the script
silently aborting.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 dim | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dim b/dim
index d944dfa..c1ac9e5 100755
--- a/dim
+++ b/dim
@@ -388,7 +388,13 @@ function dim_retip
 	local branch upstream remote
 
 	branch="$1"
-	shift
+
+	if [ -n "$branch" ] ; then
+		shift
+	else
+		branch=$(git symbolic-ref --short HEAD)
+	fi
+
 	remote=$(url_to_remote $drm_tip_ssh)
 	upstream=$(git_find_tip "$branch")
 
-- 
GitLab