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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a16dc5cd
Commit
a16dc5cd
authored
Aug 21, 2017
by
Alejandro Rodríguez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure Rugged methods are called with a Rugged Commit
parent
89969d0a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
7 deletions
+15
-7
app/models/repository.rb
app/models/repository.rb
+1
-1
lib/gitlab/conflict/file_collection.rb
lib/gitlab/conflict/file_collection.rb
+2
-2
lib/gitlab/git/commit.rb
lib/gitlab/git/commit.rb
+11
-3
spec/migrations/migrate_process_commit_worker_jobs_spec.rb
spec/migrations/migrate_process_commit_worker_jobs_spec.rb
+1
-1
No files found.
app/models/repository.rb
View file @
a16dc5cd
...
...
@@ -763,7 +763,7 @@ class Repository
index
=
Gitlab
::
Git
::
Index
.
new
(
raw_repository
)
if
start_commit
index
.
read_tree
(
start_commit
.
r
aw
_commit
.
tree
)
index
.
read_tree
(
start_commit
.
r
ugged
_commit
.
tree
)
parents
=
[
start_commit
.
sha
]
else
parents
=
[]
...
...
lib/gitlab/conflict/file_collection.rb
View file @
a16dc5cd
...
...
@@ -77,8 +77,8 @@ EOM
def
initialize
(
merge_request
,
project
)
@merge_request
=
merge_request
@our_commit
=
merge_request
.
source_branch_head
.
raw
.
r
aw
_commit
@their_commit
=
merge_request
.
target_branch_head
.
raw
.
r
aw
_commit
@our_commit
=
merge_request
.
source_branch_head
.
raw
.
r
ugged
_commit
@their_commit
=
merge_request
.
target_branch_head
.
raw
.
r
ugged
_commit
@project
=
project
end
end
...
...
lib/gitlab/git/commit.rb
View file @
a16dc5cd
...
...
@@ -14,7 +14,7 @@ module Gitlab
attr_accessor
*
SERIALIZE_KEYS
# rubocop:disable Lint/AmbiguousOperator
delegate
:tree
,
to: :r
aw
_commit
delegate
:tree
,
to: :r
ugged
_commit
def
==
(
other
)
return
false
unless
other
.
is_a?
(
Gitlab
::
Git
::
Commit
)
...
...
@@ -287,7 +287,7 @@ module Gitlab
# empty repo. See Repository#diff for keys allowed in the +options+
# hash.
def
diff_from_parent
(
options
=
{})
Commit
.
diff_from_parent
(
r
aw
_commit
,
options
)
Commit
.
diff_from_parent
(
r
ugged
_commit
,
options
)
end
def
deltas
...
...
@@ -335,7 +335,7 @@ module Gitlab
def
to_patch
(
options
=
{})
begin
r
aw
_commit
.
to_mbox
(
options
)
r
ugged
_commit
.
to_mbox
(
options
)
rescue
Rugged
::
InvalidError
=>
ex
if
ex
.
message
=~
/commit \w+ is a merge commit/i
'Patch format is not currently supported for merge commits.'
...
...
@@ -383,6 +383,14 @@ module Gitlab
encode!
@committer_email
end
def
rugged_commit
@rugged_commit
||=
if
raw_commit
.
is_a?
(
Rugged
::
Commit
)
raw_commit
else
@repository
.
rev_parse_target
(
id
)
end
end
private
def
init_from_hash
(
hash
)
...
...
spec/migrations/migrate_process_commit_worker_jobs_spec.rb
View file @
a16dc5cd
...
...
@@ -6,7 +6,7 @@ require Rails.root.join('db', 'migrate', '20161124141322_migrate_process_commit_
describe
MigrateProcessCommitWorkerJobs
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:commit
)
{
project
.
commit
.
raw
.
r
aw
_commit
}
let
(
:commit
)
{
project
.
commit
.
raw
.
r
ugged
_commit
}
describe
'Project'
do
describe
'find_including_path'
do
...
...
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