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
0fa94a0d
Commit
0fa94a0d
authored
Aug 02, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure the check works for paths with spaces.
parent
3598e60b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
forked_storage_check.rb
lib/gitlab/git/storage/forked_storage_check.rb
+1
-1
forked_storage_check_spec.rb
spec/lib/gitlab/git/storage/forked_storage_check_spec.rb
+22
-0
No files found.
lib/gitlab/git/storage/forked_storage_check.rb
View file @
0fa94a0d
...
@@ -51,7 +51,7 @@ module Gitlab
...
@@ -51,7 +51,7 @@ module Gitlab
end
end
def
test_script
(
path
)
def
test_script
(
path
)
"testpath=
\"
$(realpath
#{
Shellwords
.
escape
(
path
)
}
)
\"
&& stat $testpath
"
"testpath=
$(realpath
#{
Shellwords
.
escape
(
path
)
}
) && stat
\"
$testpath
\"
"
end
end
end
end
end
end
...
...
spec/lib/gitlab/git/storage/forked_storage_check_spec.rb
View file @
0fa94a0d
...
@@ -23,5 +23,27 @@ describe Gitlab::Git::Storage::ForkedStorageCheck, skip_database_cleaner: true d
...
@@ -23,5 +23,27 @@ describe Gitlab::Git::Storage::ForkedStorageCheck, skip_database_cleaner: true d
expect
(
described_class
.
storage_available?
(
existing_path
,
0.5
)).
to
be_falsey
expect
(
described_class
.
storage_available?
(
existing_path
,
0.5
)).
to
be_falsey
end
end
describe
'when using paths with spaces'
do
let
(
:test_dir
)
{
Rails
.
root
.
join
(
'tmp'
,
'tests'
,
'storage_check'
)
}
let
(
:path_with_spaces
)
{
File
.
join
(
test_dir
,
'path with spaces'
)
}
around
do
|
example
|
FileUtils
.
mkdir_p
(
path_with_spaces
)
example
.
run
FileUtils
.
rm_r
(
test_dir
)
end
it
'works for paths with spaces'
do
expect
(
described_class
.
storage_available?
(
path_with_spaces
)).
to
be_truthy
end
it
'works for a realpath with spaces'
do
symlink_location
=
File
.
join
(
test_dir
,
'a symlink'
)
FileUtils
.
ln_s
(
path_with_spaces
,
symlink_location
)
expect
(
described_class
.
storage_available?
(
symlink_location
)).
to
be_truthy
end
end
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