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
b994a65f
Commit
b994a65f
authored
Sep 07, 2012
by
randx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change gitolite backend behaviour to prevent error when config directory removed
parent
79021e67
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
lib/gitlab/backend/gitolite.rb
lib/gitlab/backend/gitolite.rb
+1
-1
lib/gitlab/backend/gitolite_config.rb
lib/gitlab/backend/gitolite_config.rb
+6
-4
No files found.
lib/gitlab/backend/gitolite.rb
View file @
b994a65f
...
...
@@ -5,7 +5,7 @@ module Gitlab
class
AccessDenied
<
StandardError
;
end
def
config
@config
||=
Gitlab
::
GitoliteConfig
.
new
Gitlab
::
GitoliteConfig
.
new
end
def
set_key
key_id
,
key_content
,
projects
...
...
lib/gitlab/backend/gitolite_config.rb
View file @
b994a65f
...
...
@@ -4,8 +4,10 @@ require 'fileutils'
module
Gitlab
class
GitoliteConfig
def
config_tmp_dir
@config_tmp_dir
||=
File
.
join
(
Rails
.
root
,
'tmp'
,
"gitlabhq-gitolite-
#{
Time
.
now
.
to_i
}
"
)
attr_reader
:config_tmp_dir
def
reset_config_tmp_dir
@config_tmp_dir
=
File
.
join
(
Rails
.
root
,
'tmp'
,
"gitlabhq-gitolite-
#{
Time
.
now
.
to_i
}
"
)
end
def
apply
...
...
@@ -13,9 +15,11 @@ module Gitlab
File
.
open
(
File
.
join
(
Rails
.
root
,
'tmp'
,
"gitlabhq-gitolite.lock"
),
"w+"
)
do
|
f
|
begin
f
.
flock
(
File
::
LOCK_EX
)
reset_config_tmp_dir
pull
yield
(
self
)
push
FileUtils
.
rm_rf
(
config_tmp_dir
)
ensure
f
.
flock
(
File
::
LOCK_UN
)
end
...
...
@@ -160,8 +164,6 @@ module Gitlab
`git commit -am "GitLab"`
`git push`
Dir
.
chdir
(
Rails
.
root
)
FileUtils
.
rm_rf
(
config_tmp_dir
)
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