Browse Source

Merge pull request #638 from Eliastik/master

Fix issue with Curl and space characters in filename
pull/581/merge
Maikel 1 year ago
committed by GitHub
parent
commit
34654170a6
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      git-ftp
  2. 13
      tests/git-ftp-test.sh

1
git-ftp

@ -479,6 +479,7 @@ upload_file_buffered() {
local SRC_FILE="$1"
local DEST_FILE="${SRC_FILE#$SYNCROOT}"
local ENC_DEST_FILE="${DEST_FILE//#/%23}"
local ENC_DEST_FILE="${ENC_DEST_FILE// /%20}"
echo "-T \"./$SRC_FILE\"
url = \"$REMOTE_BASE_URL/${REMOTE_PATH}${ENC_DEST_FILE}\"" >> "$TMP_CURL_UPLOAD_FILE"
}

13
tests/git-ftp-test.sh

@ -873,6 +873,19 @@ test_file_with_dash() {
assertFalse "file $dir/$file still exists in $CURL_URL" "remote_file_exists '$dir/$file'"
}
# issue #633
test_file_with_spaces() {
init=$($GIT_FTP init)
# add a file
file='file with spaces in filename.txt'
echo "1" > "./$file"
git add "$file"
git commit -m "change" > /dev/null 2>&1
push=$($GIT_FTP push)
rtrn=$?
assertEquals 0 $rtrn
}
test_syncroot() {
syncroot='foo bar'
mkdir "$syncroot" && echo "test" > "$syncroot/syncroot.txt"

Loading…
Cancel
Save