[PATCH 1/2] dim: Make branch_to_remote more robust

Daniel Vetter daniel.vetter at ffwll.ch
Tue May 22 09:14:46 UTC 2018


The old version relied on branch@{upstream}, which requires that
the branch is checked out. Instead use the indirection through the
abstract drm-tip repo.

Cc: Jani Nikula <jani.nikula at intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
 dim | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dim b/dim
index f57dfc2df489..118c446b87d5 100755
--- a/dim
+++ b/dim
@@ -248,11 +248,11 @@ function pick_protocol_url # (git|ssh|https|whatever) url [url ...]
 
 function branch_to_remote # branch
 {
-	local branch remote
+	local branch remote repo
 
 	branch=$1
-	remote=$(git rev-parse --abbrev-ref --symbolic-full-name "$branch@{upstream}")
-	remote=${remote%%/*}
+	repo=$(branch_to_repo $branch)
+	remote=$(repo_to_remote $repo)
 
 	echo $remote
 }
-- 
2.17.0



More information about the dim-tools mailing list