Skip to content
Snippets Groups Projects
Commit 36b11c53 authored by Paul Reichelt's avatar Paul Reichelt Committed by singapore
Browse files

Fix: filepath encoding for gitlab createFile and updateFile (#993)

Relates to #962 and #968

Auto detected file names are not encoded correctly so here's a fix for that.
parent 00dabb5d
No related branches found
No related tags found
No related merge requests found
......@@ -498,7 +498,10 @@ async function createFile(branchName, filePath, fileContents, message) {
content: Buffer.from(fileContents).toString('base64'),
};
} else {
url = `projects/${config.repoName}/repository/files/${filePath}`;
url = `projects/${config.repoName}/repository/files/${filePath.replace(
/\//g,
'%2F'
)}`;
opts.body = {
branch: branchName,
commit_message: message,
......@@ -523,7 +526,10 @@ async function updateFile(branchName, filePath, fileContents, message) {
content: Buffer.from(fileContents).toString('base64'),
};
} else {
url = `projects/${config.repoName}/repository/files/${filePath}`;
url = `projects/${config.repoName}/repository/files/${filePath.replace(
/\//g,
'%2F'
)}`;
opts.body = {
branch: branchName,
commit_message: message,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment