Commit d9c20cf5a63dd1f337e408d26eb3f68750dadb75

Authored by Dmitriy Zaporozhets
1 parent b6fc0310

Fix 404 errors on Merge Request -> new

app/helpers/commits_helper.rb
@@ -65,4 +65,9 @@ module CommitsHelper @@ -65,4 +65,9 @@ module CommitsHelper
65 end 65 end
66 end 66 end
67 67
  68 + def commit_to_html commit
  69 + if commit.model
  70 + escape_javascript(render 'commits/commit', commit: commit)
  71 + end
  72 + end
68 end 73 end
app/views/merge_requests/branch_from.js.haml
1 :plain 1 :plain
2 - $(".mr_source_commit").html("#{escape_javascript(render 'commits/commit', commit: @commit)}"); 2 + $(".mr_source_commit").html("#{commit_to_html(@commit)}");
app/views/merge_requests/branch_to.js.haml
1 :plain 1 :plain
2 - $(".mr_target_commit").html("#{escape_javascript(render 'commits/commit', commit: @commit)}");  
3 - 2 + $(".mr_target_commit").html("#{commit_to_html(@commit)}");