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
Boxiang Sun
gitlab-ce
Commits
3a4ecfd0
Commit
3a4ecfd0
authored
Jun 05, 2018
by
Jacob Vosmaer (GitLab)
Committed by
Sean McGivern
Jun 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent Gitaly WriteConfig log noise
parent
40dc82f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+5
-0
spec/lib/gitlab/git/repository_spec.rb
spec/lib/gitlab/git/repository_spec.rb
+12
-0
No files found.
lib/gitlab/git/repository.rb
View file @
3a4ecfd0
...
...
@@ -1397,6 +1397,11 @@ module Gitlab
def
write_config
(
full_path
:)
return
unless
full_path
.
present?
# This guard avoids Gitaly log/error spam
unless
exists?
raise
NoRepository
,
'repository does not exist'
end
gitaly_migrate
(
:write_config
)
do
|
is_enabled
|
if
is_enabled
gitaly_repository_client
.
write_config
(
full_path:
full_path
)
...
...
spec/lib/gitlab/git/repository_spec.rb
View file @
3a4ecfd0
...
...
@@ -2002,6 +2002,18 @@ describe Gitlab::Git::Repository, seed_helper: true do
expect
(
config
).
to
include
(
"fullpath =
#{
repository_path
}
"
)
end
end
context
'repository does not exist'
do
it
'raises NoRepository and does not call Gitaly WriteConfig'
do
repository
=
Gitlab
::
Git
::
Repository
.
new
(
'default'
,
'does/not/exist.git'
,
''
)
expect
(
repository
.
gitaly_repository_client
).
not_to
receive
(
:write_config
)
expect
do
repository
.
write_config
(
full_path:
'foo/bar.git'
)
end
.
to
raise_error
(
Gitlab
::
Git
::
Repository
::
NoRepository
)
end
end
end
context
"when gitaly_write_config is enabled"
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