From 632d22acf765339a35e4552b43e680398bddbf65 Mon Sep 17 00:00:00 2001 From: "P.S.V.R" Date: Mon, 18 Apr 2016 16:27:51 +0800 Subject: [PATCH] Mark Commit persisted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- app/models/commit.rb | 8 ++++++++ app/views/projects/commit/_change.html.haml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/models/commit.rb b/app/models/commit.rb index 0b924b063a4..3365f4ffdbf 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -318,6 +318,14 @@ class Commit Gitlab::Diff::FileCollection::Commit.new(self, diff_options: diff_options) end + def persisted? + true + end + + def touch + # no-op but needs to be defined since #persisted? is defined + end + private def commit_reference(from_project, referable_commit_id, full: false) diff --git a/app/views/projects/commit/_change.html.haml b/app/views/projects/commit/_change.html.haml index 12e4280d344..990908211de 100644 --- a/app/views/projects/commit/_change.html.haml +++ b/app/views/projects/commit/_change.html.haml @@ -13,7 +13,7 @@ %a.close{ href: "#", "data-dismiss" => "modal" } × %h3.page-title== #{label} this #{commit.change_type_title(current_user)} .modal-body - = form_tag send("#{type.underscore}_namespace_project_commit_path", @project.namespace, @project, commit.id), method: :post, remote: false, class: "form-horizontal js-#{type}-form js-requires-input" do + = form_tag [type.underscore, @project.namespace, @project, commit], method: :post, remote: false, class: "form-horizontal js-#{type}-form js-requires-input" do .form-group.branch = label_tag 'target_branch', target_label, class: 'control-label' .col-sm-10 -- GitLab