BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c6dee998
Commit
c6dee998
authored
Jul 21, 2017
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename path_with_namespace -> disk_path when dealing with the filesystem
parent
abb87832
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
26 additions
and
26 deletions
+26
-26
project.rb
app/models/project.rb
+2
-2
destroy_service.rb
app/services/projects/destroy_service.rb
+1
-1
export_service.rb
app/services/projects/import_export/export_service.rb
+1
-1
import_service.rb
app/services/projects/import_service.rb
+1
-1
repository.rb
lib/backup/repository.rb
+2
-2
repo_restorer.rb
lib/gitlab/import_export/repo_restorer.rb
+1
-1
projects.rb
spec/factories/projects.rb
+2
-2
notification_service_spec.rb
spec/lib/gitlab/gitaly_client/notification_service_spec.rb
+1
-1
ref_service_spec.rb
spec/lib/gitlab/gitaly_client/ref_service_spec.rb
+1
-1
jira_service_spec.rb
spec/models/project_services/jira_service_spec.rb
+3
-3
project_spec.rb
spec/models/project_spec.rb
+6
-6
repository_spec.rb
spec/models/repository_spec.rb
+1
-1
transfer_service_spec.rb
spec/services/projects/transfer_service_spec.rb
+1
-1
backup_rake_spec.rb
spec/tasks/gitlab/backup_rake_spec.rb
+3
-3
No files found.
app/models/project.rb
View file @
c6dee998
...
...
@@ -1198,7 +1198,7 @@ class Project < ActiveRecord::Base
end
def
pages_path
File
.
join
(
Settings
.
pages
.
path
,
path_with_namespace
)
File
.
join
(
Settings
.
pages
.
path
,
disk_path
)
end
def
public_pages_path
...
...
@@ -1256,7 +1256,7 @@ class Project < ActiveRecord::Base
end
def
export_path
File
.
join
(
Gitlab
::
ImportExport
.
storage_path
,
path_with_namespace
)
File
.
join
(
Gitlab
::
ImportExport
.
storage_path
,
disk_path
)
end
def
export_project_path
...
...
app/services/projects/destroy_service.rb
View file @
c6dee998
...
...
@@ -40,7 +40,7 @@ module Projects
private
def
repo_path
project
.
path_with_namespace
project
.
disk_path
end
def
wiki_path
...
...
app/services/projects/import_export/export_service.rb
View file @
c6dee998
...
...
@@ -2,7 +2,7 @@ module Projects
module
ImportExport
class
ExportService
<
BaseService
def
execute
(
_options
=
{})
@shared
=
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
File
.
join
(
project
.
path_with_namespace
,
'work'
))
@shared
=
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
File
.
join
(
project
.
disk_path
,
'work'
))
save_all
end
...
...
app/services/projects/import_service.rb
View file @
c6dee998
...
...
@@ -51,7 +51,7 @@ module Projects
end
def
clone_repository
gitlab_shell
.
import_repository
(
project
.
repository_storage_path
,
project
.
path_with_namespace
,
project
.
import_url
)
gitlab_shell
.
import_repository
(
project
.
repository_storage_path
,
project
.
disk_path
,
project
.
import_url
)
end
def
fetch_repository
...
...
lib/backup/repository.rb
View file @
c6dee998
...
...
@@ -142,11 +142,11 @@ module Backup
end
def
path_to_bundle
(
project
)
File
.
join
(
backup_repos_path
,
project
.
path_with_namespace
+
'.bundle'
)
File
.
join
(
backup_repos_path
,
project
.
disk_path
+
'.bundle'
)
end
def
path_to_tars
(
project
,
dir
=
nil
)
path
=
File
.
join
(
backup_repos_path
,
project
.
path_with_namespace
)
path
=
File
.
join
(
backup_repos_path
,
project
.
disk_path
)
if
dir
File
.
join
(
path
,
"
#{
dir
}
.tar"
)
...
...
lib/gitlab/import_export/repo_restorer.rb
View file @
c6dee998
...
...
@@ -13,7 +13,7 @@ module Gitlab
def
restore
return
true
unless
File
.
exist?
(
@path_to_bundle
)
gitlab_shell
.
import_repository
(
@project
.
repository_storage_path
,
@project
.
path_with_namespace
,
@path_to_bundle
)
gitlab_shell
.
import_repository
(
@project
.
repository_storage_path
,
@project
.
disk_path
,
@path_to_bundle
)
rescue
=>
e
@shared
.
error
(
e
)
false
...
...
spec/factories/projects.rb
View file @
c6dee998
...
...
@@ -64,7 +64,7 @@ FactoryGirl.define do
# We delete hooks so that gitlab-shell will not try to authenticate with
# an API that isn't running
FileUtils
.
rm_r
(
File
.
join
(
project
.
repository_storage_path
,
"
#{
project
.
path_with_namespace
}
.git"
,
'hooks'
))
FileUtils
.
rm_r
(
File
.
join
(
project
.
repository_storage_path
,
"
#{
project
.
disk_path
}
.git"
,
'hooks'
))
end
end
...
...
@@ -72,7 +72,7 @@ FactoryGirl.define do
after
(
:create
)
do
|
project
|
raise
"Failed to create repository!"
unless
project
.
create_repository
FileUtils
.
rm_r
(
File
.
join
(
project
.
repository_storage_path
,
"
#{
project
.
path_with_namespace
}
.git"
,
'refs'
))
FileUtils
.
rm_r
(
File
.
join
(
project
.
repository_storage_path
,
"
#{
project
.
disk_path
}
.git"
,
'refs'
))
end
end
...
...
spec/lib/gitlab/gitaly_client/notification_service_spec.rb
View file @
c6dee998
...
...
@@ -4,7 +4,7 @@ describe Gitlab::GitalyClient::NotificationService do
describe
'#post_receive'
do
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:storage_name
)
{
project
.
repository_storage
}
let
(
:relative_path
)
{
project
.
path_with_namespace
+
'.git'
}
let
(
:relative_path
)
{
project
.
disk_path
+
'.git'
}
subject
{
described_class
.
new
(
project
.
repository
)
}
it
'sends a post_receive message'
do
...
...
spec/lib/gitlab/gitaly_client/ref_service_spec.rb
View file @
c6dee998
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
Gitlab
::
GitalyClient
::
RefService
do
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:storage_name
)
{
project
.
repository_storage
}
let
(
:relative_path
)
{
project
.
path_with_namespace
+
'.git'
}
let
(
:relative_path
)
{
project
.
disk_path
+
'.git'
}
let
(
:client
)
{
described_class
.
new
(
project
.
repository
)
}
describe
'#branches'
do
...
...
spec/models/project_services/jira_service_spec.rb
View file @
c6dee998
...
...
@@ -135,7 +135,7 @@ describe JiraService do
body:
hash_including
(
GlobalID
:
"GitLab"
,
object:
{
url:
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
project
.
path_with_namespace
}
/commit/
#{
merge_request
.
diff_head_sha
}
"
,
url:
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
project
.
full_path
}
/commit/
#{
merge_request
.
diff_head_sha
}
"
,
title:
"GitLab: Solved by commit
#{
merge_request
.
diff_head_sha
}
."
,
icon:
{
title:
"GitLab"
,
url16x16:
"https://gitlab.com/favicon.ico"
},
status:
{
resolved:
true
}
...
...
@@ -159,7 +159,7 @@ describe JiraService do
@jira_service
.
close_issue
(
merge_request
,
ExternalIssue
.
new
(
"JIRA-123"
,
project
))
expect
(
WebMock
).
to
have_requested
(
:post
,
@comment_url
).
with
(
body:
/
#{
custom_base_url
}
\/
#{
project
.
path_with_namespace
}
\/commit\/
#{
merge_request
.
diff_head_sha
}
/
body:
/
#{
custom_base_url
}
\/
#{
project
.
full_path
}
\/commit\/
#{
merge_request
.
diff_head_sha
}
/
).
once
end
...
...
@@ -174,7 +174,7 @@ describe JiraService do
@jira_service
.
close_issue
(
merge_request
,
ExternalIssue
.
new
(
"JIRA-123"
,
project
))
expect
(
WebMock
).
to
have_requested
(
:post
,
@comment_url
).
with
(
body:
/
#{
Gitlab
.
config
.
gitlab
.
url
}
\/
#{
project
.
path_with_namespace
}
\/commit\/
#{
merge_request
.
diff_head_sha
}
/
body:
/
#{
Gitlab
.
config
.
gitlab
.
url
}
\/
#{
project
.
full_path
}
\/commit\/
#{
merge_request
.
diff_head_sha
}
/
).
once
end
...
...
spec/models/project_spec.rb
View file @
c6dee998
...
...
@@ -1369,7 +1369,7 @@ describe Project do
context
'using a regular repository'
do
it
'creates the repository'
do
expect
(
shell
).
to
receive
(
:add_repository
)
.
with
(
project
.
repository_storage_path
,
project
.
path_with_namespace
)
.
with
(
project
.
repository_storage_path
,
project
.
disk_path
)
.
and_return
(
true
)
expect
(
project
.
repository
).
to
receive
(
:after_create
)
...
...
@@ -1379,7 +1379,7 @@ describe Project do
it
'adds an error if the repository could not be created'
do
expect
(
shell
).
to
receive
(
:add_repository
)
.
with
(
project
.
repository_storage_path
,
project
.
path_with_namespace
)
.
with
(
project
.
repository_storage_path
,
project
.
disk_path
)
.
and_return
(
false
)
expect
(
project
.
repository
).
not_to
receive
(
:after_create
)
...
...
@@ -1412,7 +1412,7 @@ describe Project do
.
and_return
(
false
)
allow
(
shell
).
to
receive
(
:add_repository
)
.
with
(
project
.
repository_storage_path
,
project
.
path_with_namespace
)
.
with
(
project
.
repository_storage_path
,
project
.
disk_path
)
.
and_return
(
true
)
expect
(
project
).
to
receive
(
:create_repository
).
with
(
force:
true
)
...
...
@@ -1436,7 +1436,7 @@ describe Project do
.
and_return
(
false
)
expect
(
shell
).
to
receive
(
:add_repository
)
.
with
(
project
.
repository_storage_path
,
project
.
path_with_namespace
)
.
with
(
project
.
repository_storage_path
,
project
.
disk_path
)
.
and_return
(
true
)
project
.
ensure_repository
...
...
@@ -1600,7 +1600,7 @@ describe Project do
before
do
allow_any_instance_of
(
Gitlab
::
Shell
).
to
receive
(
:import_repository
)
.
with
(
project
.
repository_storage_path
,
project
.
path_with_namespace
,
project
.
import_url
)
.
with
(
project
.
repository_storage_path
,
project
.
disk_path
,
project
.
import_url
)
.
and_return
(
true
)
expect_any_instance_of
(
Repository
).
to
receive
(
:after_import
)
...
...
@@ -1738,7 +1738,7 @@ describe Project do
it
'schedules a RepositoryForkWorker job'
do
expect
(
RepositoryForkWorker
).
to
receive
(
:perform_async
)
.
with
(
project
.
id
,
forked_from_project
.
repository_storage_path
,
forked_from_project
.
path_with_namespace
,
project
.
namespace
.
full_path
)
forked_from_project
.
disk_path
,
project
.
namespace
.
full_path
)
project
.
add_import_job
end
...
...
spec/models/repository_spec.rb
View file @
c6dee998
...
...
@@ -962,7 +962,7 @@ describe Repository do
end
it
'returns false if no full path can be constructed'
do
allow
(
repository
).
to
receive
(
:
path_with_namespace
).
and_return
(
nil
)
allow
(
repository
).
to
receive
(
:
full_path
).
and_return
(
nil
)
expect
(
repository
.
exists?
).
to
eq
(
false
)
end
...
...
spec/services/projects/transfer_service_spec.rb
View file @
c6dee998
...
...
@@ -59,7 +59,7 @@ describe Projects::TransferService do
end
def
project_path
(
project
)
File
.
join
(
project
.
repository_storage_path
,
"
#{
project
.
path_with_namespace
}
.git"
)
File
.
join
(
project
.
repository_storage_path
,
"
#{
project
.
disk_path
}
.git"
)
end
def
current_path
...
...
spec/tasks/gitlab/backup_rake_spec.rb
View file @
c6dee998
...
...
@@ -117,7 +117,7 @@ describe 'gitlab:app namespace rake task' do
describe
'backup creation and deletion using custom_hooks'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user_backup_path
)
{
"repositories/
#{
project
.
path_with_namespace
}
"
}
let
(
:user_backup_path
)
{
"repositories/
#{
project
.
disk_path
}
"
}
before
(
:each
)
do
@origin_cd
=
Dir
.
pwd
...
...
@@ -261,8 +261,8 @@ describe 'gitlab:app namespace rake task' do
%W{tar -tvf
#{
@backup_tar
}
repositories}
)
expect
(
exit_status
).
to
eq
(
0
)
expect
(
tar_contents
).
to
match
(
"repositories/
#{
project_a
.
path_with_namespace
}
.bundle"
)
expect
(
tar_contents
).
to
match
(
"repositories/
#{
project_b
.
path_with_namespace
}
.bundle"
)
expect
(
tar_contents
).
to
match
(
"repositories/
#{
project_a
.
disk_path
}
.bundle"
)
expect
(
tar_contents
).
to
match
(
"repositories/
#{
project_b
.
disk_path
}
.bundle"
)
end
end
end
# backup_create task
...
...
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