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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
2b127c3f
Commit
2b127c3f
authored
Aug 18, 2015
by
Stan Hu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
parents
cc871c0c
798f2fe1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
1 deletion
+21
-1
CHANGELOG
CHANGELOG
+2
-1
app/models/repository.rb
app/models/repository.rb
+4
-0
lib/gitlab/satellite/merge_action.rb
lib/gitlab/satellite/merge_action.rb
+1
-0
spec/lib/gitlab/satellite/merge_action_spec.rb
spec/lib/gitlab/satellite/merge_action_spec.rb
+14
-0
No files found.
CHANGELOG
View file @
2b127c3f
...
...
@@ -2,7 +2,9 @@ Please view this file on the master branch, on stable branches it's out of date.
v 7.14.0 (unreleased)
- Update default robots.txt rules to disallow crawling of irrelevant pages (Ben Bodenmiller)
- Fix redirection after sign in when using auto_sign_in_with_provider
- Upgrade gitlab_git to 7.2.14 to ignore CRLFs in .gitmodules (Stan Hu)
- Clear cache to prevent listing deleted branches after MR removes source branch (Stan Hu)
- Provide more feedback what went wrong if HipChat service failed test (Stan Hu)
- Fix bug where backslashes in inline diffs could be dropped (Stan Hu)
- Disable turbolinks when linking to Bitbucket import status (Stan Hu)
...
...
@@ -68,7 +70,6 @@ v 7.13.5
v 7.13.4
- Allow users to send abuse reports
- Fix redirection after sign in when using auto_sign_in_with_provider
v 7.13.3
- Fix bug causing Bitbucket importer to crash when OAuth application had been removed.
...
...
app/models/repository.rb
View file @
2b127c3f
...
...
@@ -148,6 +148,10 @@ class Repository
@lookup_cache
||=
{}
end
def
expire_branch_names
cache
.
expire
(
:branch_names
)
end
def
method_missing
(
m
,
*
args
,
&
block
)
if
m
==
:lookup
&&
!
block_given?
lookup_cache
[
m
]
||=
{}
...
...
lib/gitlab/satellite/merge_action.rb
View file @
2b127c3f
...
...
@@ -36,6 +36,7 @@ module Gitlab
if
merge_request
.
remove_source_branch?
# will raise CommandFailed when push fails
merge_repo
.
git
.
push
(
default_options
,
:origin
,
":
#{
merge_request
.
source_branch
}
"
)
merge_request
.
source_project
.
repository
.
expire_branch_names
end
# merge, push and branch removal successful
true
...
...
spec/lib/gitlab/satellite/merge_action_spec.rb
View file @
2b127c3f
...
...
@@ -101,4 +101,18 @@ describe 'Gitlab::Satellite::MergeAction' do
end
end
end
describe
'#merge!'
do
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
,
source_branch:
"markdown"
,
should_remove_source_branch:
true
)
}
let
(
:merge_action
)
{
Gitlab
::
Satellite
::
MergeAction
.
new
(
merge_request
.
author
,
merge_request
)
}
it
'clears cache of source repo after removing source branch'
do
project
.
repository
.
expire_branch_names
expect
(
project
.
repository
.
branch_names
).
to
include
(
'markdown'
)
merge_action
.
merge!
expect
(
project
.
repository
.
branch_names
).
not_to
include
(
'markdown'
)
end
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