From ef7a9553e603e4dd6d0bdf648bce1684a198f835 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Thu, 1 Jun 2017 14:47:47 +0300
Subject: [PATCH] - Fix issues found with shellcheck.

---
 tests/files/receiver.sh | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/tests/files/receiver.sh b/tests/files/receiver.sh
index bb74eb6..70c7a8c 100644
--- a/tests/files/receiver.sh
+++ b/tests/files/receiver.sh
@@ -13,16 +13,17 @@ fetch_submodules () {
 
     # We read the submodules from .gitmodules
     git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
-        while read path_key path
+        while read -r path_key path
         do
-            rm -fr $path
-            url_key=`echo $path_key | sed 's/\.path/.url/'`
-            url=`git config -f .gitmodules --get "$url_key"`
-            git submodule add $url $path
+            rm -fr "$path"
+            url_key="$(echo "$path_key" | sed 's/\.path/.url/')"
+            url="$(git config -f .gitmodules --get "$url_key")"
+            git submodule add "$url" "$path"
         done
 }
 
 mkdir -p /var/tmp/gitreceive
+(
 cd /var/tmp/gitreceive
 echo '----> Unpacking ...'
 tar -xf -
@@ -37,6 +38,6 @@ then
     ./receiver
 fi
 echo '----> Cleanup ...'
-cd -
+)
 rm -rf /var/tmp/gitreceive
 echo '----> OK.'
-- 
GitLab