aboutsummaryrefslogtreecommitdiff
path: root/git-checkout-branch
diff options
context:
space:
mode:
Diffstat (limited to 'git-checkout-branch')
-rwxr-xr-xgit-checkout-branch6
1 files changed, 5 insertions, 1 deletions
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