Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
c43e18fc
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c43e18fc
编写于
3月 28, 2018
作者:
J
Jacob Vosmaer (GitLab)
提交者:
Sean McGivern
3月 28, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove some easy cases of 'path_to_repo' use
上级
066d2e0a
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
16 addition
and
41 deletion
+16
-41
app/models/project_services/gemnasium_service.rb
app/models/project_services/gemnasium_service.rb
+1
-1
app/models/repository.rb
app/models/repository.rb
+0
-4
app/views/admin/projects/show.html.haml
app/views/admin/projects/show.html.haml
+7
-3
app/workers/git_garbage_collect_worker.rb
app/workers/git_garbage_collect_worker.rb
+5
-4
app/workers/repository_fork_worker.rb
app/workers/repository_fork_worker.rb
+1
-0
lib/gitlab/bare_repository_import/importer.rb
lib/gitlab/bare_repository_import/importer.rb
+1
-1
lib/gitlab/workhorse.rb
lib/gitlab/workhorse.rb
+0
-2
spec/lib/gitlab/workhorse_spec.rb
spec/lib/gitlab/workhorse_spec.rb
+0
-3
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+0
-22
spec/requests/git_http_spec.rb
spec/requests/git_http_spec.rb
+1
-1
未找到文件。
app/models/project_services/gemnasium_service.rb
浏览文件 @
c43e18fc
...
...
@@ -36,7 +36,7 @@ class GemnasiumService < Service
after:
data
[
:after
],
token:
token
,
api_key:
api_key
,
repo:
project
.
repository
.
path_to_repo
repo:
project
.
repository
.
path_to_repo
# Gitaly: fixed by https://gitlab.com/gitlab-org/security-products/gemnasium-migration/issues/9
)
end
end
app/models/repository.rb
浏览文件 @
c43e18fc
...
...
@@ -93,10 +93,6 @@ class Repository
"#<
#{
self
.
class
.
name
}
:
#{
@disk_path
}
>"
end
def
create_hooks
Gitlab
::
Git
::
Repository
.
create_hooks
(
path_to_repo
,
Gitlab
.
config
.
gitlab_shell
.
hooks_path
)
end
def
commit
(
ref
=
'HEAD'
)
return
nil
unless
exists?
return
ref
if
ref
.
is_a?
(
::
Commit
)
...
...
app/views/admin/projects/show.html.haml
浏览文件 @
c43e18fc
...
...
@@ -62,12 +62,16 @@
=
link_to
@project
.
ssh_url_to_repo
,
project_path
(
@project
)
-
if
@project
.
repository
.
exists?
%li
%span
.light
fs
:
%span
.light
Gitaly storage name
:
%strong
=
@project
.
repository
.
path_to_repo
=
@project
.
repository
.
storage
%li
%span
.light
Gitaly relative path:
%strong
=
@project
.
repository
.
relative_path
%li
%span
.light
Storage:
%span
.light
Storage
used
:
%strong
=
storage_counter
(
@project
.
statistics
.
storage_size
)
(
=
storage_counter
(
@project
.
statistics
.
repository_size
)
...
...
app/workers/git_garbage_collect_worker.rb
浏览文件 @
c43e18fc
...
...
@@ -28,16 +28,17 @@ class GitGarbageCollectWorker
task
=
task
.
to_sym
cmd
=
command
(
task
)
repo_path
=
project
.
repository
.
path_to_repo
description
=
"'
#{
cmd
.
join
(
' '
)
}
' in
#{
repo_path
}
"
Gitlab
::
GitLogger
.
info
(
description
)
gitaly_migrate
(
GITALY_MIGRATED_TASKS
[
task
])
do
|
is_enabled
|
if
is_enabled
gitaly_call
(
task
,
project
.
repository
.
raw_repository
)
else
repo_path
=
project
.
repository
.
path_to_repo
description
=
"'
#{
cmd
.
join
(
' '
)
}
' in
#{
repo_path
}
"
Gitlab
::
GitLogger
.
info
(
description
)
output
,
status
=
Gitlab
::
Popen
.
popen
(
cmd
,
repo_path
)
Gitlab
::
GitLogger
.
error
(
"
#{
description
}
failed:
\n
#{
output
}
"
)
unless
status
.
zero?
end
end
...
...
app/workers/repository_fork_worker.rb
浏览文件 @
c43e18fc
# Gitaly issue: https://gitlab.com/gitlab-org/gitaly/issues/1110
class
RepositoryForkWorker
include
ApplicationWorker
include
Gitlab
::
ShellAdapter
...
...
lib/gitlab/bare_repository_import/importer.rb
浏览文件 @
c43e18fc
...
...
@@ -63,7 +63,7 @@ module Gitlab
log
" * Created
#{
project
.
name
}
(
#{
project_full_path
}
)"
.
color
(
:green
)
project
.
write_repository_config
project
.
repository
.
create_hooks
Gitlab
::
Git
::
Repository
.
create_hooks
(
project
.
repository
.
path_to_repo
,
Gitlab
.
config
.
gitlab_shell
.
hooks_path
)
ProjectCacheWorker
.
perform_async
(
project
.
id
)
else
...
...
lib/gitlab/workhorse.rb
浏览文件 @
c43e18fc
...
...
@@ -21,12 +21,10 @@ module Gitlab
raise
"Unsupported action:
#{
action
}
"
unless
ALLOWED_GIT_HTTP_ACTIONS
.
include?
(
action
.
to_s
)
project
=
repository
.
project
repo_path
=
repository
.
path_to_repo
params
=
{
GL_ID
:
Gitlab
::
GlId
.
gl_id
(
user
),
GL_REPOSITORY
:
Gitlab
::
GlRepository
.
gl_repository
(
project
,
is_wiki
),
GL_USERNAME
:
user
&
.
username
,
RepoPath
:
repo_path
,
ShowAllRefs
:
show_all_refs
}
server
=
{
...
...
spec/lib/gitlab/workhorse_spec.rb
浏览文件 @
c43e18fc
...
...
@@ -275,14 +275,12 @@ describe Gitlab::Workhorse do
describe
'.git_http_ok'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:repo_path
)
{
repository
.
path_to_repo
}
let
(
:action
)
{
'info_refs'
}
let
(
:params
)
do
{
GL_ID
:
"user-
#{
user
.
id
}
"
,
GL_USERNAME
:
user
.
username
,
GL_REPOSITORY
:
"project-
#{
project
.
id
}
"
,
RepoPath
:
repo_path
,
ShowAllRefs
:
false
}
end
...
...
@@ -297,7 +295,6 @@ describe Gitlab::Workhorse do
GL_ID
:
"user-
#{
user
.
id
}
"
,
GL_USERNAME
:
user
.
username
,
GL_REPOSITORY
:
"wiki-
#{
project
.
id
}
"
,
RepoPath
:
repo_path
,
ShowAllRefs
:
false
}
end
...
...
spec/models/repository_spec.rb
浏览文件 @
c43e18fc
...
...
@@ -501,28 +501,6 @@ describe Repository do
end
end
describe
'#create_hooks'
do
let
(
:hook_path
)
{
File
.
join
(
repository
.
path_to_repo
,
'hooks'
)
}
it
'symlinks the global hooks directory'
do
repository
.
create_hooks
expect
(
File
.
symlink?
(
hook_path
)).
to
be
true
expect
(
File
.
readlink
(
hook_path
)).
to
eq
(
Gitlab
.
config
.
gitlab_shell
.
hooks_path
)
end
it
'replaces existing symlink with the right directory'
do
FileUtils
.
mkdir_p
(
hook_path
)
expect
(
File
.
symlink?
(
hook_path
)).
to
be
false
repository
.
create_hooks
expect
(
File
.
symlink?
(
hook_path
)).
to
be
true
expect
(
File
.
readlink
(
hook_path
)).
to
eq
(
Gitlab
.
config
.
gitlab_shell
.
hooks_path
)
end
end
describe
"#create_dir"
do
it
"commits a change that creates a new directory"
do
expect
do
...
...
spec/requests/git_http_spec.rb
浏览文件 @
c43e18fc
...
...
@@ -163,7 +163,7 @@ describe 'Git HTTP requests' do
download
(
path
)
do
|
response
|
json_body
=
ActiveSupport
::
JSON
.
decode
(
response
.
body
)
expect
(
json_body
[
'Repo
Path'
]).
to
include
(
wiki
.
repository
.
disk
_path
)
expect
(
json_body
[
'Repo
sitory'
][
'relative_path'
]).
to
eq
(
wiki
.
repository
.
relative
_path
)
end
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录