core: merge default synced folders ,don't override [GH-2873]

This commit is contained in:
Mitchell Hashimoto 2014-01-21 20:13:08 -08:00
parent e80552b6aa
commit 2b9e7ca14e
3 changed files with 6 additions and 1 deletions

View File

@ -60,6 +60,8 @@ BUG FIXES:
indefinitely. [GH-2756]
- core: Windows checks home directory permissions more correctly to
warn of potential issues.
- core: Synced folders set to the default synced folder explicitly won't
be deleted. [GH-2873]
- commands/box: Box add `--force` works with `--provider` flag. [GH-2757]
- commands/box: Listing boxes with machine-readable output crash is gone.
- commands/plugin: Plugin installation will fail if dependencies conflict,

View File

@ -96,7 +96,8 @@ module Vagrant
raise Errors::NoDefaultSyncedFolderImpl, types: types
end
folders[default_impl] = folders[""]
folders[default_impl] ||= {}
folders[default_impl].merge!(folders[""])
folders.delete("")
end

View File

@ -75,12 +75,14 @@ describe Vagrant::Action::Builtin::MixinSyncedFolders do
it "should return the proper set of folders" do
folders["root"] = {}
folders["another"] = { type: "" }
folders["foo"] = { type: "default" }
folders["nfs"] = { type: "nfs" }
result = subject.synced_folders(machine)
result.length.should == 2
result[:default].should == {
"another" => folders["another"],
"foo" => folders["foo"],
"root" => folders["root"],
}
result[:nfs].should == { "nfs" => folders["nfs"] }