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
5fb3a786
Commit
5fb3a786
authored
Feb 03, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix conflicts in Repository and spec
parent
64b6fc08
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
52 deletions
+3
-52
app/models/repository.rb
app/models/repository.rb
+3
-49
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+0
-3
No files found.
app/models/repository.rb
View file @
5fb3a786
...
@@ -9,12 +9,9 @@ class Repository
...
@@ -9,12 +9,9 @@ class Repository
attr_accessor
:path_with_namespace
,
:project
attr_accessor
:path_with_namespace
,
:project
CommitError
=
Class
.
new
(
StandardError
)
CommitError
=
Class
.
new
(
StandardError
)
<<<<<<<
HEAD
MIRROR_REMOTE
=
"upstream"
MIRROR_REMOTE
=
"upstream"
MIRROR_GEO
=
"geo"
MIRROR_GEO
=
"geo"
=======
>>>>>>>
ce
/
master
# Methods that cache data from the Git repository.
# Methods that cache data from the Git repository.
#
#
...
@@ -73,17 +70,14 @@ class Repository
...
@@ -73,17 +70,14 @@ class Repository
@raw_repository
||=
Gitlab
::
Git
::
Repository
.
new
(
path_to_repo
)
@raw_repository
||=
Gitlab
::
Git
::
Repository
.
new
(
path_to_repo
)
end
end
<<<<<<<
HEAD
def
storage_path
def
storage_path
@project
.
repository_storage_path
@project
.
repository_storage_path
end
end
=======
>>>>>>>
ce
/
master
# Return absolute path to repository
# Return absolute path to repository
def
path_to_repo
def
path_to_repo
@path_to_repo
||=
File
.
expand_path
(
@path_to_repo
||=
File
.
expand_path
(
File
.
join
(
storage_path
,
path_with_namespace
+
".git"
)
File
.
join
(
@project
.
repository_
storage_path
,
path_with_namespace
+
".git"
)
)
)
end
end
...
@@ -191,13 +185,10 @@ class Repository
...
@@ -191,13 +185,10 @@ class Repository
find_branch
(
branch_name
)
find_branch
(
branch_name
)
end
end
<<<<<<<
HEAD
def
push_remote_branches
(
remote
,
branches
)
def
push_remote_branches
(
remote
,
branches
)
gitlab_shell
.
push_remote_branches
(
storage_path
,
path_with_namespace
,
remote
,
branches
)
gitlab_shell
.
push_remote_branches
(
storage_path
,
path_with_namespace
,
remote
,
branches
)
end
end
=======
>>>>>>>
ce
/
master
def
add_tag
(
user
,
tag_name
,
target
,
message
=
nil
)
def
add_tag
(
user
,
tag_name
,
target
,
message
=
nil
)
newrev
=
commit
(
target
).
try
(
:id
)
newrev
=
commit
(
target
).
try
(
:id
)
options
=
{
message:
message
,
tagger:
user_to_committer
(
user
)
}
if
message
options
=
{
message:
message
,
tagger:
user_to_committer
(
user
)
}
if
message
...
@@ -219,13 +210,10 @@ class Repository
...
@@ -219,13 +210,10 @@ class Repository
true
true
end
end
<<<<<<<
HEAD
def
delete_remote_branches
(
remote
,
branches
)
def
delete_remote_branches
(
remote
,
branches
)
gitlab_shell
.
delete_remote_branches
(
storage_path
,
path_with_namespace
,
remote
,
branches
)
gitlab_shell
.
delete_remote_branches
(
storage_path
,
path_with_namespace
,
remote
,
branches
)
end
end
=======
>>>>>>>
ce
/
master
def
rm_tag
(
user
,
tag_name
)
def
rm_tag
(
user
,
tag_name
)
before_remove_tag
before_remove_tag
tag
=
find_tag
(
tag_name
)
tag
=
find_tag
(
tag_name
)
...
@@ -234,7 +222,6 @@ class Repository
...
@@ -234,7 +222,6 @@ class Repository
after_remove_tag
after_remove_tag
true
true
<<<<<<<
HEAD
end
end
def
config
def
config
...
@@ -269,8 +256,6 @@ class Repository
...
@@ -269,8 +256,6 @@ class Repository
gitlab_shell
.
list_remote_tags
(
storage_path
,
path_with_namespace
,
remote
).
map
do
|
name
,
target
|
gitlab_shell
.
list_remote_tags
(
storage_path
,
path_with_namespace
,
remote
).
map
do
|
name
,
target
|
Gitlab
::
Git
::
Tag
.
new
(
raw_repository
,
name
,
target
)
Gitlab
::
Git
::
Tag
.
new
(
raw_repository
,
name
,
target
)
end
end
=======
>>>>>>>
ce
/
master
end
end
def
ref_names
def
ref_names
...
@@ -820,7 +805,6 @@ class Repository
...
@@ -820,7 +805,6 @@ class Repository
alias_method
:branches
,
:local_branches
alias_method
:branches
,
:local_branches
<<<<<<<
HEAD
def
remote_branches
(
remote_name
)
def
remote_branches
(
remote_name
)
branches
=
[]
branches
=
[]
...
@@ -854,25 +838,6 @@ class Repository
...
@@ -854,25 +838,6 @@ class Repository
check_tree_entry_for_dir
(
start_branch_name
,
path
)
check_tree_entry_for_dir
(
start_branch_name
,
path
)
end
end
=======
def
tags
@tags
||=
raw_repository
.
tags
end
# rubocop:disable Metrics/ParameterLists
def
commit_dir
(
user
,
path
,
message
:,
branch_name
:,
author_email:
nil
,
author_name:
nil
,
start_branch_name:
nil
,
start_project:
project
)
check_tree_entry_for_dir
(
branch_name
,
path
)
if
start_branch_name
start_project
.
repository
.
check_tree_entry_for_dir
(
start_branch_name
,
path
)
end
>>>>>>>
ce
/
master
commit_file
(
commit_file
(
user
,
user
,
"
#{
path
}
/.gitkeep"
,
"
#{
path
}
/.gitkeep"
,
...
@@ -1025,7 +990,6 @@ class Repository
...
@@ -1025,7 +990,6 @@ class Repository
end
end
end
end
<<<<<<<
HEAD
def
ff_merge
(
user
,
source
,
target_branch
,
merge_request:
nil
)
def
ff_merge
(
user
,
source
,
target_branch
,
merge_request:
nil
)
our_commit
=
rugged
.
branches
[
target_branch
].
target
our_commit
=
rugged
.
branches
[
target_branch
].
target
their_commit
=
their_commit
=
...
@@ -1034,18 +998,10 @@ class Repository
...
@@ -1034,18 +998,10 @@ class Repository
else
else
rugged
.
lookup
(
source
)
rugged
.
lookup
(
source
)
end
end
=======
def
merge
(
user
,
source
,
merge_request
,
options
=
{})
GitOperationService
.
new
(
user
,
self
).
with_branch
(
merge_request
.
target_branch
)
do
|
start_commit
|
our_commit
=
start_commit
.
sha
their_commit
=
source
>>>>>>>
ce
/
master
raise
'Invalid merge target'
unless
our_commit
raise
'Invalid merge target'
if
our_commit
.
nil?
raise
'Invalid merge source'
unless
their_commit
raise
'Invalid merge source'
if
their_commit
.
nil?
<<<<<<<
HEAD
GitOperationService
.
new
(
user
,
self
).
with_branch
(
GitOperationService
.
new
(
user
,
self
).
with_branch
(
target_branch
)
do
|
start_commit
|
target_branch
)
do
|
start_commit
|
if
merge_request
if
merge_request
...
@@ -1065,8 +1021,6 @@ class Repository
...
@@ -1065,8 +1021,6 @@ class Repository
raise
'Invalid merge target'
unless
our_commit
raise
'Invalid merge target'
unless
our_commit
raise
'Invalid merge source'
unless
their_commit
raise
'Invalid merge source'
unless
their_commit
=======
>>>>>>>
ce
/
master
merge_index
=
rugged
.
merge_commits
(
our_commit
,
their_commit
)
merge_index
=
rugged
.
merge_commits
(
our_commit
,
their_commit
)
break
if
merge_index
.
conflicts?
break
if
merge_index
.
conflicts?
...
...
spec/models/repository_spec.rb
View file @
5fb3a786
...
@@ -1092,7 +1092,6 @@ describe Repository, models: true do
...
@@ -1092,7 +1092,6 @@ describe Repository, models: true do
merge_request
.
diff_head_sha
,
merge_request
.
diff_head_sha
,
merge_request
,
merge_request
,
commit_options
)
commit_options
)
<<<<<<<
HEAD
expect
(
merge_request
.
in_progress_merge_commit_sha
).
to
eq
(
merge_commit_id
)
expect
(
merge_request
.
in_progress_merge_commit_sha
).
to
eq
(
merge_commit_id
)
end
end
...
@@ -1119,8 +1118,6 @@ describe Repository, models: true do
...
@@ -1119,8 +1118,6 @@ describe Repository, models: true do
merge_request
.
diff_head_sha
,
merge_request
.
diff_head_sha
,
merge_request
.
target_branch
,
merge_request
.
target_branch
,
merge_request:
merge_request
)
merge_request:
merge_request
)
=======
>>>>>>>
ce
/
master
expect
(
merge_request
.
in_progress_merge_commit_sha
).
to
eq
(
merge_commit_id
)
expect
(
merge_request
.
in_progress_merge_commit_sha
).
to
eq
(
merge_commit_id
)
end
end
...
...
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