mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Fix gitlab saver (#4243)
This fixes the HTTP request sent to gitlab that is meant to see if the target file already exists. It did not follow the official gitlab v4 api documentation. That documentation dictates both `path` and `branch` to be passed via corresponding GET parameters.
This commit is contained in:
parent
1631f21a6b
commit
11506e9acf
@ -48,12 +48,9 @@ GitLabSaver.prototype.save = function(text,method,callback) {
|
||||
var uri = endpoint + "/projects/" + encodeURIComponent(repo) + "/repository/";
|
||||
// Perform a get request to get the details (inc shas) of files in the same path as our file
|
||||
$tw.utils.httpRequest({
|
||||
url: uri + "tree/" + encodeURIComponent(path.replace(/^\/+|\/$/g, '')),
|
||||
url: uri + "tree/?path=" + encodeURIComponent(path.replace(/^\/+|\/$/g, '')) + "&branch=" + encodeURIComponent(branch.replace(/^\/+|\/$/g, '')),
|
||||
type: "GET",
|
||||
headers: headers,
|
||||
data: {
|
||||
ref: branch
|
||||
},
|
||||
callback: function(err,getResponseDataJson,xhr) {
|
||||
var getResponseData,sha = "";
|
||||
if(err && xhr.status !== 404) {
|
||||
|
Loading…
Reference in New Issue
Block a user