summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-01-17 15:51:06 +0000
committerRobert Speicher <robert@gitlab.com>2017-01-17 15:51:06 +0000
commitcfdae8f103568d843afb3c714444c912510a5f1f (patch)
tree2d76a9a6ebd7225e399bc6cf71798158ba167ee7
parente7fdb1aae5a61b30f66ea3489d4e0759ed8ea3a1 (diff)
parent632d22acf765339a35e4552b43e680398bddbf65 (diff)
downloadgitlab-ce-cfdae8f103568d843afb3c714444c912510a5f1f.tar.gz
Merge branch 'pmq20/gitlab-ce-psvr/persisted' into 'master'
Mark Commits as persisted See merge request !8604
-rw-r--r--app/models/commit.rb8
-rw-r--r--app/views/projects/commit/_change.html.haml2
2 files changed, 9 insertions, 1 deletions
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