From f6c51aa078f5ed8137704fb352c207dbaa04738d Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.anjos@idiap.ch>
Date: Fri, 23 Jun 2017 16:21:21 +0200
Subject: [PATCH] Remove double slash (try 3)

---
 gitlab/functions.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gitlab/functions.sh b/gitlab/functions.sh
index faa0646..06f0691 100644
--- a/gitlab/functions.sh
+++ b/gitlab/functions.sh
@@ -263,15 +263,16 @@ dav_upload_folder() {
     # with the server path prefix ('private-upload/docs/test/')
     # to make something like '../folder1/folder2/folder-to-upload/test.txt'
     # into 'private-upload/docs/test.txt'
-    local server_path="${fname/$1/}"
+    local server_prefix="${2%?}" #without ending slash
+    local server_path="${fname/$1/$2}"
 
     # if its a file...
     if [[ -f "${fname}" ]]; then
       # upload the file ...
-      dav_upload "${fname}" "${2}${server_path}"
+      dav_upload "${fname}" "${server_path}"
     else
       # if its a dir, create the dir
-      dav_mkdir "${2}${server_path}"
+      dav_mkdir "${server_path}"
     fi
   done
 }
-- 
GitLab