Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
b1ab079f
Commit
b1ab079f
authored
Jul 14, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix updated_at not preserved after import - for GitLab projects
parent
af2bcffb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
lib/gitlab/import_export/project_tree_restorer.rb
lib/gitlab/import_export/project_tree_restorer.rb
+4
-1
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+8
-0
No files found.
lib/gitlab/import_export/project_tree_restorer.rb
View file @
b1ab079f
...
...
@@ -12,7 +12,10 @@ module Gitlab
json
=
IO
.
read
(
@path
)
@tree_hash
=
ActiveSupport
::
JSON
.
decode
(
json
)
@project_members
=
@tree_hash
.
delete
(
'project_members'
)
create_relations
ActiveRecord
::
Base
.
no_touching
do
create_relations
end
rescue
=>
e
@shared
.
error
(
e
)
false
...
...
spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
View file @
b1ab079f
...
...
@@ -30,6 +30,14 @@ describe Gitlab::ImportExport::ProjectTreeRestorer, services: true do
expect
(
Event
.
where
.
not
(
data:
nil
).
first
.
data
[
:ref
]).
not_to
be_empty
end
it
'preserves updated_at on issues'
do
restored_project_json
issue
=
Issue
.
where
(
description:
'Aliquam enim illo et possimus.'
).
first
expect
(
issue
.
reload
.
updated_at
.
to_s
).
to
eq
(
'2016-06-14 15:02:47 UTC'
)
end
context
'event at forth level of the tree'
do
let
(
:event
)
{
Event
.
where
(
title:
'test levels'
).
first
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment