diff options
Diffstat (limited to 'app/services/merge_requests/conflicts/resolve_service.rb')
-rw-r--r-- | app/services/merge_requests/conflicts/resolve_service.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/services/merge_requests/conflicts/resolve_service.rb b/app/services/merge_requests/conflicts/resolve_service.rb index d74a82effd6..c2c335b8461 100644 --- a/app/services/merge_requests/conflicts/resolve_service.rb +++ b/app/services/merge_requests/conflicts/resolve_service.rb @@ -37,11 +37,13 @@ module MergeRequests private def write_resolved_file_to_index(merge_index, rugged, file, params) - new_file = if params[:sections] - file.resolve_lines(params[:sections]).map(&:text).join("\n") - elsif params[:content] - file.resolve_content(params[:content]) - end + if params[:sections] + new_file = file.resolve_lines(params[:sections]).map(&:text).join("\n") + + new_file << "\n" if file.our_blob.data.ends_with?("\n") + elsif params[:content] + new_file = file.resolve_content(params[:content]) + end our_path = file.our_path |