From ec8e28032b3c73da9b55852ab4e29fc8b2efcf1d Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 11 Dec 2017 10:51:11 -0200 Subject: Fix GIT_SSH_COMMAND usage --- git-checkout-branch | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'git-checkout-branch') diff --git a/git-checkout-branch b/git-checkout-branch index a237a23..260b46e 100755 --- a/git-checkout-branch +++ b/git-checkout-branch @@ -30,7 +30,11 @@ function checkout_branch { GIT_SSH_COMMAND="`git config core.sshCommand`" # Fetch from all repositories - GIT_SSH_COMMAND="$GIT_SSH_COMMAND" git fetch --all + if [ ! -z "$GIT_SSH_COMMAND" ]; then + GIT_SSH_COMMAND="$GIT_SSH_COMMAND" git fetch --all + else + git fetch --all + fi # Check if we are in a detached HEAD if git branch | grep -q '* (HEAD detached'; then -- cgit v1.2.3