[Intel-gfx] [dim PATCH 5/7] dim: fix list-upstreams when not in a git repo or with a drm upstream in place

Jani Nikula jani.nikula at intel.com
Thu Nov 24 11:20:38 UTC 2016


'dim list-upstreams' is needed by bash completion and is used outside of
git repos, also within git repos without drm upstream, so don't fail if
it can be avoided.

Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 dim | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dim b/dim
index ac0be0b97ea1..fded4e669176 100755
--- a/dim
+++ b/dim
@@ -1216,7 +1216,11 @@ function dim_list_upstreams
 {
 	local dim_drm_upstream_remote
 
-	dim_drm_upstream_remote=`url_to_remote $drm_upstream_git`
+	# Handle failures gracefully
+	if ! dim_drm_upstream_remote=$(url_to_remote $drm_upstream_git 2>/dev/null); then
+		return 0
+	fi
+
 	echo origin/master
 	echo $dim_drm_upstream_remote/drm-next
 	echo $dim_drm_upstream_remote/drm-fixes
-- 
2.1.4



More information about the Intel-gfx mailing list