aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-checkout-branch6
-rwxr-xr-xgit-update-superproject8
2 files changed, 12 insertions, 2 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
diff --git a/git-update-superproject b/git-update-superproject
index a39efe6..603053a 100755
--- a/git-update-superproject
+++ b/git-update-superproject
@@ -19,5 +19,11 @@ GIT_SSH_COMMAND="`git config core.sshCommand`"
git fetch --all
git pull $* || exit 1
git submodule sync --recursive
-GIT_SSH_COMMAND="$GIT_SSH_COMMAND" git submodule update --recursive --init
+
+if [ ! -z "$GIT_SSH_COMMAND" ]; then
+ GIT_SSH_COMMAND="$GIT_SSH_COMMAND" git submodule update --recursive --init
+else
+ git submodule update --recursive --init
+fi
+
git submodules-checkout-branch