diff options
author | Gabriel Gizotti <gabriel@gizotti.com> | 2016-11-27 20:40:56 +1000 |
---|---|---|
committer | Gabriel Gizotti <gabriel@gizotti.com> | 2016-12-16 19:13:17 +1000 |
commit | 1a72dc2486601eadec03122f8124d3b553df3571 (patch) | |
tree | 91d9b7046aa08e55939b412cb9e43230cb682683 | |
parent | 00a842eacc4b2ff1514b258fbf08e4017f3be447 (diff) | |
download | gitlab-ce-1a72dc2486601eadec03122f8124d3b553df3571.tar.gz |
keep branch being merged, MR title and MR reference in merge commit message when using description
-rw-r--r-- | app/views/shared/_commit_message_container.html.haml | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/views/shared/_commit_message_container.html.haml b/app/views/shared/_commit_message_container.html.haml index adee374413f..706eef5a331 100644 --- a/app/views/shared/_commit_message_container.html.haml +++ b/app/views/shared/_commit_message_container.html.haml @@ -27,15 +27,21 @@ $('.use-description-link').on('click', function(e) { e.preventDefault(); + var message = "Merge branch '#{j @merge_request.source_branch}' into '#{j @merge_request.target_branch}'\n\n" + message = message + "#{j @merge_request.title}\n\n" + message = message + "#{j local_assigns[:description]}\n\n"; + message = message + "See merge request #{j @merge_request.to_reference}" + + $('.use-description-hint').hide(); $('.use-default-message-hint').show(); - $('.js-commit-message').val("#{escape_javascript local_assigns[:description]}"); + $('.js-commit-message').val(message) }); $('.use-default-message-link').on('click', function(e) { e.preventDefault(); - var defaultMessage = "#{escape_javascript (params[:commit_message] || local_assigns[:text] || local_assigns[:placeholder])}"; + var defaultMessage = "#{j (params[:commit_message] || local_assigns[:text] || local_assigns[:placeholder])}"; $('.use-description-hint').show(); $('.use-default-message-hint').hide(); |