Merge pull request #11089 from briancain/rsync-helper-regex-path-fix
Fixes #10966: Ensure all subdirectory files are watched
This commit is contained in:
commit
f92e1a1973
|
@ -30,6 +30,10 @@ module VagrantPlugins
|
|||
exclude = exclude[1..-1]
|
||||
end
|
||||
|
||||
exclude = "#{exclude}/" if !exclude.end_with?("/")
|
||||
exclude = "^#{exclude}"
|
||||
exclude += ".*" if !start_anchor
|
||||
|
||||
# This is not an ideal solution, but it's a start. We can improve and
|
||||
# keep unit tests passing in the future.
|
||||
exclude = exclude.gsub("**", "|||GLOBAL|||")
|
||||
|
|
|
@ -33,22 +33,22 @@ describe VagrantPlugins::SyncedFolderRSync::RsyncHelper do
|
|||
|
||||
it "converts a directory match" do
|
||||
expect(described_class.exclude_to_regexp("foo/")).
|
||||
to eq(/foo\//)
|
||||
to eq(/^foo\/.[^\/]*/)
|
||||
end
|
||||
|
||||
it "converts the start anchor" do
|
||||
expect(described_class.exclude_to_regexp("/foo")).
|
||||
to eq(/foo/)
|
||||
to eq(/^foo\//)
|
||||
end
|
||||
|
||||
it "converts the **" do
|
||||
expect(described_class.exclude_to_regexp("fo**o")).
|
||||
to eq(/fo.*o/)
|
||||
to eq(/^fo.*o\/.[^\/]*/)
|
||||
end
|
||||
|
||||
it "converts the *" do
|
||||
expect(described_class.exclude_to_regexp("fo*o")).
|
||||
to eq(/fo[^\/]*o/)
|
||||
to eq(/^fo[^\/]*o\/.[^\/]*/)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue