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
Léo-Paul Géneau
gitlab-ce
Commits
569a88a4
Commit
569a88a4
authored
Jan 19, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
raise exception if gitolite is broken
parent
5c3fdfaa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
app/views/errors/gitolite.html.haml
app/views/errors/gitolite.html.haml
+1
-1
lib/gitlab/backend/gitolite_config.rb
lib/gitlab/backend/gitolite_config.rb
+14
-1
No files found.
app/views/errors/gitolite.html.haml
View file @
569a88a4
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
%p
%p
Diagnostic tool:
Diagnostic tool:
%pre
%pre
bundle exec rake gitlab:
app:status
RAILS_ENV=production
bundle exec rake gitlab:
check
RAILS_ENV=production
%li
%li
%p
%p
Permissions:
Permissions:
...
...
lib/gitlab/backend/gitolite_config.rb
View file @
569a88a4
...
@@ -6,6 +6,7 @@ module Gitlab
...
@@ -6,6 +6,7 @@ module Gitlab
class
GitoliteConfig
class
GitoliteConfig
class
PullError
<
StandardError
;
end
class
PullError
<
StandardError
;
end
class
PushError
<
StandardError
;
end
class
PushError
<
StandardError
;
end
class
BrokenGitolite
<
StandardError
;
end
attr_reader
:config_tmp_dir
,
:ga_repo
,
:conf
attr_reader
:config_tmp_dir
,
:ga_repo
,
:conf
...
@@ -72,6 +73,10 @@ module Gitlab
...
@@ -72,6 +73,10 @@ module Gitlab
log
(
"Push error -> "
+
" "
+
ex
.
message
)
log
(
"Push error -> "
+
" "
+
ex
.
message
)
raise
Gitolite
::
AccessDenied
,
ex
.
message
raise
Gitolite
::
AccessDenied
,
ex
.
message
rescue
BrokenGitolite
=>
ex
log
(
"Gitolite error -> "
+
" "
+
ex
.
message
)
raise
Gitolite
::
AccessDenied
,
ex
.
message
rescue
Exception
=>
ex
rescue
Exception
=>
ex
log
(
ex
.
class
.
name
+
" "
+
ex
.
message
)
log
(
ex
.
class
.
name
+
" "
+
ex
.
message
)
raise
Gitolite
::
AccessDenied
.
new
(
"gitolite timeout"
)
raise
Gitolite
::
AccessDenied
.
new
(
"gitolite timeout"
)
...
@@ -202,7 +207,15 @@ module Gitlab
...
@@ -202,7 +207,15 @@ module Gitlab
system
(
'git commit -m "GitLab"'
)
# git commit returns 0 on success, and 1 if there is nothing to commit
system
(
'git commit -m "GitLab"'
)
# git commit returns 0 on success, and 1 if there is nothing to commit
raise
"Git commit failed."
unless
[
0
,
1
].
include?
$?
.
exitstatus
raise
"Git commit failed."
unless
[
0
,
1
].
include?
$?
.
exitstatus
if
system
(
'git push'
)
stdin
,
stdout
,
stderr
=
Open3
.
popen3
(
'git push'
)
push_output
=
stderr
.
read
push_status
=
$?
.
to_i
if
push_output
=~
/remote\: FATAL/
raise
BrokenGitolite
,
push_output
end
if
push_status
.
zero?
Dir
.
chdir
(
Rails
.
root
)
Dir
.
chdir
(
Rails
.
root
)
else
else
raise
PushError
,
"unable to push gitolite-admin repo"
raise
PushError
,
"unable to push gitolite-admin repo"
...
...
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