From 49085342eddc71906df583beacafd855d2caca90 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 18 Aug 2019 21:19:19 +0300 Subject: [PATCH] .shellrc: Fix `cdremote`: Skip branch without upstream --- .shellrc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.shellrc b/.shellrc index 1920ed7..513431d 100644 --- a/.shellrc +++ b/.shellrc @@ -220,13 +220,7 @@ if test -x /usr/bin/git >/dev/null 2>&1; then remote="$1" fi - if [ -z "$remote" ]; then - echo "Cannot find remote for branch $branch" >&2 - echo "Usage: cdremote [remote_name]" >&2 - return 1 - fi - - if git config --get remote.$remote.url | grep -q '^\(file:/\|/\|\.\./\)'; then + if [ -n "$remote" ] && git config --get remote.$remote.url | grep -q '^\(file:/\|/\|\.\./\)'; then cdgitpath remote.$remote.url else -- 2.39.5