From a45e88ec2b91b08e11ac5d87ab6a1b5a9780d128 Mon Sep 17 00:00:00 2001 From: Jani Nikula <jani.nikula@intel.com> Date: Tue, 10 Oct 2017 00:02:35 +0300 Subject: [PATCH] dim: actually use the remote name asked from the user Broken since introduction in cad37e1910f9 ("dim: auto-add remotes"), the remote asked from the user gets ignored. Get the remote name to the remote variable. Also bail out on non-zero returns from read. Cc: Daniel Vetter <daniel@ffwll.ch> Acked-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Jani Nikula <jani.nikula@intel.com> --- dim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dim b/dim index af22f94..449e12e 100755 --- a/dim +++ b/dim @@ -269,8 +269,8 @@ function url_to_remote # url [url ...] url=$1 remote=${url%.git} remote=${remote##*/} - read -r -i "$remote" -e -p "Enter a name to auto-add this remote, leave blank to abort: " || true - if [[ "$REPLY" == "" ]] ; then + read -r -i "$remote" -e -p "Enter a name to auto-add this remote, leave blank to abort: " remote + if [[ -z "$remote" ]]; then echoerr "Please set it up yourself using:" echoerr " $ git remote add <name> $url" echoerr "with a name of your choice." -- GitLab