summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-06-29 16:19:09 -0500
committermicael.bergeron <micaelbergeron@gmail.com>2017-12-07 09:01:19 -0500
commite4eba908cd85c3ad7b9861c3edbd3c81623242a0 (patch)
tree51704b1351f78fcd3de4a59399b10c5c3f64d70d /app/helpers
parent17542a7895f288b8e7bc92836039f4dcbb7c17d2 (diff)
downloadgitlab-ce-e4eba908cd85c3ad7b9861c3edbd3c81623242a0.tar.gz
Allow commenting on individual commits inside an MR
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/commits_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index f68e2cd3afa..361d56b211c 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -228,4 +228,12 @@ module CommitsHelper
[commits, 0]
end
end
+
+ def commit_path(project, commit, merge_request: nil)
+ if merge_request&.persisted?
+ diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, commit_id: commit.id)
+ else
+ namespace_project_commit_path(project.namespace, project, commit.id)
+ end
+ end
end