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
0b965528
Commit
0b965528
authored
Jan 23, 2018
by
Ahmad Sherif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GitalyClient::ConflictsService#conflicts? should return true for conflicts with missing side
parent
fbbd81ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
lib/gitlab/gitaly_client/conflicts_service.rb
lib/gitlab/gitaly_client/conflicts_service.rb
+5
-0
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+7
-1
No files found.
lib/gitlab/gitaly_client/conflicts_service.rb
View file @
0b965528
...
@@ -25,6 +25,11 @@ module Gitlab
...
@@ -25,6 +25,11 @@ module Gitlab
def
conflicts?
def
conflicts?
list_conflict_files
.
any?
list_conflict_files
.
any?
rescue
GRPC
::
FailedPrecondition
# The server raises this exception when it encounters ConflictSideMissing, which
# means a conflict exists but its `theirs` or `ours` data is nil due to a non-existent
# file in one of the trees.
true
end
end
def
resolve_conflicts
(
target_repository
,
resolution
,
source_branch
,
target_branch
)
def
resolve_conflicts
(
target_repository
,
resolution
,
source_branch
,
target_branch
)
...
...
spec/models/repository_spec.rb
View file @
0b965528
...
@@ -365,12 +365,18 @@ describe Repository do
...
@@ -365,12 +365,18 @@ describe Repository do
it
{
is_expected
.
to
be_truthy
}
it
{
is_expected
.
to
be_truthy
}
end
end
context
'non-mergeable branches'
do
context
'non-mergeable branches
without conflict sides missing
'
do
subject
{
repository
.
can_be_merged?
(
'bb5206fee213d983da88c47f9cf4cc6caf9c66dc'
,
'feature'
)
}
subject
{
repository
.
can_be_merged?
(
'bb5206fee213d983da88c47f9cf4cc6caf9c66dc'
,
'feature'
)
}
it
{
is_expected
.
to
be_falsey
}
it
{
is_expected
.
to
be_falsey
}
end
end
context
'non-mergeable branches with conflict sides missing'
do
subject
{
repository
.
can_be_merged?
(
'conflict-missing-side'
,
'conflict-start'
)
}
it
{
is_expected
.
to
be_falsey
}
end
context
'non merged branch'
do
context
'non merged branch'
do
subject
{
repository
.
merged_to_root_ref?
(
'fix'
)
}
subject
{
repository
.
merged_to_root_ref?
(
'fix'
)
}
...
...
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