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
e8f39a0a
Commit
e8f39a0a
authored
Sep 07, 2012
by
randx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gitolite -> more exceptions
parent
048117c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
lib/gitlab/backend/gitolite_config.rb
lib/gitlab/backend/gitolite_config.rb
+22
-4
No files found.
lib/gitlab/backend/gitolite_config.rb
View file @
e8f39a0a
...
...
@@ -4,6 +4,9 @@ require 'fileutils'
module
Gitlab
class
GitoliteConfig
class
PullError
<
StandardError
;
end
class
PushError
<
StandardError
;
end
attr_reader
:config_tmp_dir
,
:ga_repo
,
:conf
def
config_tmp_dir
...
...
@@ -54,6 +57,14 @@ module Gitlab
end
end
end
rescue
PullError
=>
ex
Gitlab
::
Logger
.
error
(
"Pull error -> "
+
ex
.
message
)
raise
Gitolite
::
AccessDenied
,
ex
.
message
rescue
PushError
=>
ex
Gitlab
::
Logger
.
error
(
"Push error -> "
+
" "
+
ex
.
message
)
raise
Gitolite
::
AccessDenied
,
ex
.
message
rescue
Exception
=>
ex
Gitlab
::
Logger
.
error
(
ex
.
class
.
name
+
" "
+
ex
.
message
)
raise
Gitolite
::
AccessDenied
.
new
(
"gitolite timeout"
)
...
...
@@ -171,14 +182,21 @@ module Gitlab
def
pull
tmp_dir
Dir
.
mkdir
tmp_dir
`git clone
#{
Gitlab
.
config
.
gitolite_admin_uri
}
#{
tmp_dir
}
/gitolite`
unless
File
.
exists?
(
File
.
join
(
tmp_dir
,
'gitolite'
,
'conf'
,
'gitolite.conf'
))
raise
PullError
,
"unable to clone gitolite-admin repo"
end
end
def
push
tmp_dir
Dir
.
chdir
(
File
.
join
(
tmp_dir
,
"gitolite"
))
`git add -A`
`git commit -am "GitLab"`
`git push`
Dir
.
chdir
(
Rails
.
root
)
system
(
'git add -A'
)
system
(
'git commit -am "GitLab"'
)
if
system
(
'git push'
)
Dir
.
chdir
(
Rails
.
root
)
else
raise
PushError
,
"unable to push gitolite-admin repo"
end
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