]> gitweb.fluxo.info Git - utils-git.git/commitdiff
Fix GIT_SSH_COMMAND usage
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 11 Dec 2017 12:51:11 +0000 (10:51 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 11 Dec 2017 12:51:11 +0000 (10:51 -0200)
git-checkout-branch
git-update-superproject

index a237a23d4f7a9c16645ca95f7be76048d8cde0ca..260b46e965169c4a0b648144503e215da13b312d 100755 (executable)
@@ -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
index a39efe64cbcfbc00bae1170132ef33b9571db4a1..603053a4f668aed9f2bc78e8bd11e9adb4de45b0 100755 (executable)
@@ -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