Method: Cnvrg::Project#compare_commit

Defined in:
lib/cnvrg/project.rb

#compare_commit(commit) ⇒ Object



523
524
525
526
527
528
529
530
531
# File 'lib/cnvrg/project.rb', line 523

def compare_commit(commit)
  if commit.nil? or commit.empty?
    commit = last_local_commit
  end
  response = Cnvrg::API.request("users/#{self.owner}/projects/#{self.slug}/commit/compare", 'POST', {current_commit: commit})
  CLI.is_response_success(response, false)
  update_is_new_branch(response["result"]["new_branch"])
  return response["result"]["new_branch"]
end