diff options
author | James Lopez <james@gitlab.com> | 2016-07-19 09:26:35 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-07-19 12:47:04 +0200 |
commit | 3eed1ea242a9176fe88deea10d41de184e1531d7 (patch) | |
tree | 9324d0db808126d9617bae9861d48fbfd49f69c9 /lib | |
parent | ca39f35e80899f61b8f4f9d1b8ff50e0f840094b (diff) | |
download | gitlab-ce-3eed1ea242a9176fe88deea10d41de184e1531d7.tar.gz |
Merge branch 'fix/import-export-encoding' into 'master'
Fix MR diff encoding issues exporting projects
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/19338
See merge request !5039
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/import_export.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/import_export/import_export.yml | 6 | ||||
-rw-r--r-- | lib/gitlab/import_export/relation_factory.rb | 5 |
3 files changed, 11 insertions, 2 deletions
diff --git a/lib/gitlab/import_export.rb b/lib/gitlab/import_export.rb index bab2ea73c4f..d6d14bd98a0 100644 --- a/lib/gitlab/import_export.rb +++ b/lib/gitlab/import_export.rb @@ -2,7 +2,7 @@ module Gitlab module ImportExport extend self - VERSION = '0.1.1' + VERSION = '0.1.2' FILENAME_LIMIT = 50 def export_path(relative_path:) diff --git a/lib/gitlab/import_export/import_export.yml b/lib/gitlab/import_export/import_export.yml index 05f4ad527ac..15afe8174a4 100644 --- a/lib/gitlab/import_export/import_export.yml +++ b/lib/gitlab/import_export/import_export.yml @@ -53,7 +53,11 @@ included_attributes: excluded_attributes: snippets: - :expired_at + merge_request_diff: + - :st_diffs methods: statuses: - - :type
\ No newline at end of file + - :type + merge_request_diff: + - :utf8_st_diffs
\ No newline at end of file diff --git a/lib/gitlab/import_export/relation_factory.rb b/lib/gitlab/import_export/relation_factory.rb index 6ba25a31641..e41c7e6bf4f 100644 --- a/lib/gitlab/import_export/relation_factory.rb +++ b/lib/gitlab/import_export/relation_factory.rb @@ -33,6 +33,7 @@ module Gitlab update_project_references reset_ci_tokens if @relation_name == 'Ci::Trigger' @relation_hash['data'].deep_symbolize_keys! if @relation_name == :events && @relation_hash['data'] + set_st_diffs if @relation_name == :merge_request_diff generate_imported_object end @@ -129,6 +130,10 @@ module Gitlab def parsed_relation_hash @relation_hash.reject { |k, _v| !relation_class.attribute_method?(k) } end + + def set_st_diffs + @relation_hash['st_diffs'] = @relation_hash.delete('utf8_st_diffs') + end end end end |