Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
GitLab
管理
动态
成员
标记
计划
议题
议题看板
里程碑
迭代
需求
代码
合并请求
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
锁定的文件
构建
流水线
作业
流水线计划
测试用例
产物
部署
发布
Package registry
Container registry
模型注册表
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
贡献者分析
CI/CD 分析
仓库分析
代码评审分析
议题分析
洞察
模型实验
效能分析
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
gitlab-cn
GitLab
提交
54a24608
提交
54a24608
编辑于
12 years ago
作者:
Dmitriy Zaporozhets
浏览文件
操作
下载
补丁
差异文件
Remove chdir inside runtime. Improved gitolite shell commands
上级
cfe89832
No related branches found
No related tags found
无相关合并请求
变更
3
隐藏空白变更内容
行内
左右并排
显示
3 个更改的文件
Gemfile
+3
-0
3 个添加, 0 个删除
Gemfile
Gemfile.lock
+6
-0
6 个添加, 0 个删除
Gemfile.lock
lib/gitlab/backend/gitolite_config.rb
+30
-14
30 个添加, 14 个删除
lib/gitlab/backend/gitolite_config.rb
有
39 个添加
和
14 个删除
Gemfile
+
3
−
0
浏览文件 @
54a24608
...
@@ -127,6 +127,9 @@ group :development do
...
@@ -127,6 +127,9 @@ group :development do
# Docs generator
# Docs generator
gem
"
sdoc
"
gem
"
sdoc
"
# thin instead webrick
gem
'
thin
'
end
end
group
:development
,
:test
do
group
:development
,
:test
do
...
...
此差异已折叠。
点击以展开。
Gemfile.lock
+
6
−
0
浏览文件 @
54a24608
...
@@ -144,6 +144,7 @@ GEM
...
@@ -144,6 +144,7 @@ GEM
colorize (0.5.8)
colorize (0.5.8)
connection_pool (1.0.0)
connection_pool (1.0.0)
crack (0.3.1)
crack (0.3.1)
daemons (1.1.9)
devise (2.1.2)
devise (2.1.2)
bcrypt-ruby (~> 3.0)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
orm_adapter (~> 0.1)
...
@@ -436,6 +437,10 @@ GEM
...
@@ -436,6 +437,10 @@ GEM
test_after_commit (0.0.1)
test_after_commit (0.0.1)
therubyracer (0.10.2)
therubyracer (0.10.2)
libv8 (~> 3.3.10)
libv8 (~> 3.3.10)
thin (1.5.0)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.16.0)
thor (0.16.0)
tilt (1.3.3)
tilt (1.3.3)
timers (1.0.2)
timers (1.0.2)
...
@@ -542,6 +547,7 @@ DEPENDENCIES
...
@@ -542,6 +547,7 @@ DEPENDENCIES
stamp
stamp
test_after_commit
test_after_commit
therubyracer
therubyracer
thin
uglifier (~> 1.3.0)
uglifier (~> 1.3.0)
unicorn (~> 4.4.0)
unicorn (~> 4.4.0)
webmock
webmock
此差异已折叠。
点击以展开。
lib/gitlab/backend/gitolite_config.rb
+
30
−
14
浏览文件 @
54a24608
...
@@ -77,9 +77,9 @@ def apply
...
@@ -77,9 +77,9 @@ def apply
log
(
"Gitolite error -> "
+
" "
+
ex
.
message
)
log
(
"Gitolite error -> "
+
" "
+
ex
.
message
)
raise
Gitolite
::
AccessDenied
,
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")
end
end
def
log
message
def
log
message
...
@@ -202,25 +202,41 @@ def pull tmp_dir
...
@@ -202,25 +202,41 @@ def pull tmp_dir
end
end
def
push
tmp_dir
def
push
tmp_dir
Dir
.
chdir
(
File
.
join
(
tmp_dir
,
"gitolite"
))
output
,
status
=
popen
(
'git add -A'
)
raise
"Git add failed."
unless
system
(
'git add -A'
)
raise
"Git add failed."
unless
status
.
zero?
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
stdin
,
stdout
,
stderr
=
Open3
.
popen3
(
'git push'
)
# git commit returns 0 on success, and 1 if there is nothing to commit
push_
output
=
stderr
.
read
output
,
status
=
popen
(
'git commit -m "GitLab"'
)
push_status
=
$?
.
to_i
raise
"Git add failed."
unless
[
0
,
1
].
include?
(
status
)
if
push_output
=~
/remote\: FATAL/
output
,
status
=
popen
(
'git push'
)
raise
BrokenGitolite
,
push_output
if
output
=~
/remote\: FATAL/
raise
BrokenGitolite
,
output
end
end
if
push_
status
.
zero?
if
status
.
zero?
||
output
=~
/Everything up\-to\-date/
Dir
.
chdir
(
Rails
.
root
)
return
true
else
else
raise
PushError
,
"unable to push gitolite-admin repo"
raise
PushError
,
"unable to push gitolite-admin repo"
end
end
end
end
def
popen
(
cmd
)
path
=
File
.
join
(
config_tmp_dir
,
'gitolite'
)
vars
=
{
"PWD"
=>
path
}
options
=
{
:chdir
=>
path
}
@cmd_output
=
""
@cmd_status
=
0
Open3
.
popen3
(
vars
,
cmd
,
options
)
do
|
stdin
,
stdout
,
stderr
,
wait_thr
|
@cmd_status
=
wait_thr
.
value
.
exitstatus
@cmd_output
<<
stdout
.
read
@cmd_output
<<
stderr
.
read
end
return
@cmd_output
,
@cmd_status
end
end
end
end
end
此差异已折叠。
点击以展开。
Takuya Noguchi
@tnir
mentioned in commit
291f2e29
·
2 years ago
mentioned in commit
291f2e29
mentioned in commit 291f2e29be2311f0f3f9cfdb3e05c32d96c2adab
展开或隐藏提交列表
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录