Skip to content
Snippets Groups Projects

Iss #154 - Encode remaining hanging esc char in JSON for ECA hook script

Merged Iss #154 - Encode remaining hanging esc char in JSON for ECA hook script
1 unresolved thread
Merged Martin Lowe requested to merge (removed):malowe/main/154 into main
1 unresolved thread
+ 3
3
@@ -122,7 +122,7 @@ end
## Get all new commits for branch, relative to itself for existing branch, relative to tree for new
diff_git_commits_raw = ''
if (previous_head_commit =~ /0+/) then
if (previous_head_commit =~ /\0+/) then
## This isn't perfect as its relative to fork, but should be huge improvement
diff_git_commits_raw = `git rev-list #{new_head_commit} --not --branches=*`
else
@@ -149,8 +149,8 @@ json_data = {
:commits => processed_git_data,
:strictMode => is_strict_enforced
}
## Generate request (use gsub to scrub any lingering \n constants)
response = HTTParty.post("#{API_URL}/git/eca", :body => MultiJson.dump(json_data).gsub(/(\\n|\\r)/, ''),
## Generate request
response = HTTParty.post("#{API_URL}/git/eca", :body => MultiJson.dump(json_data),
:headers => {
'Content-Type' => 'application/json',
'charset' => 'utf-8'
Loading