aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-12-11 10:51:11 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-12-11 10:51:11 -0200
commitec8e28032b3c73da9b55852ab4e29fc8b2efcf1d (patch)
treec90de05e95043bd55e9713334ac12ec4e12a7bc4
parenta9b0c1d89e82452c0e799ae7e4674b991e8a011b (diff)
downloadutils-git-ec8e28032b3c73da9b55852ab4e29fc8b2efcf1d.tar.gz
utils-git-ec8e28032b3c73da9b55852ab4e29fc8b2efcf1d.tar.bz2
Fix GIT_SSH_COMMAND usage
-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