[PATCH] dim: actually use the remote name asked from the user

Jani Nikula jani.nikula at intel.com
Mon Oct 9 21:06:37 UTC 2017


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 at ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 dim | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dim b/dim
index af22f94ccdd5..449e12e7e936 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."
-- 
2.11.0



More information about the dim-tools mailing list