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
1
Merge Requests
1
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
nexedi
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
lib/gitlab/git/storage/forked_storage_check.rb
lib/gitlab/git/storage/forked_storage_check.rb
+1
-1
spec/lib/gitlab/git/storage/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
end
def
test_script
(
path
)
"testpath=
\"
$(realpath
#{
Shellwords
.
escape
(
path
)
}
)
\"
&& stat $testpath
"
"testpath=
$(realpath
#{
Shellwords
.
escape
(
path
)
}
) && stat
\"
$testpath
\"
"
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
expect
(
described_class
.
storage_available?
(
existing_path
,
0.5
)).
to
be_falsey
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
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