stefanpenner/ember-cli — pull request #2512 by DanyHunter (2014-11-17 16:20:44+00:00)
Title: Remove requirements of directory having to exist when creating a treeFor hook.

Right now, if you add a `treeFor...` hook it requires for the respective directory from the `treeForPaths` to exist. This pull request fixes that. It took me and @jakecraige by surprise on more than one occasion to see why it was not being called.

This change has side effects, but **it won't affect existing addons**. This method now works differently than it used to in that it's possible for the tree that's passed in to the treeFor method to be `undefined`.

If addon developers decide to not merge the tree, it could cause them unexpected behavior when they later decide to add the `app/styles` directory and then it's not merged. Addon developers can prevent this going forward if they define their hooks similar to the example below:

```js
treeForStyles: function(tree) {
var myCustomTree = this.treeGenerator('the/path/to/tree');

return this.mergeTrees([tree, myCustomTree].filter(Boolean));
}
```

This will make sure that even if the tree is undefined, it's not passed to mergeTrees since it will throw an error if it's undefined.