twitter/bower — pull request #331 by josh (2013-03-20 01:29:31+00:00)
Title: component.json package name should be authoritative

Take 2 of #268, also see #313.

There were a couple issues with just changing the package name.

1. `this.dependencies[pkg.name]` would still remain as mapping between the old package name after `loadJSON` was invoked. This would cause a dependency resolution when installing a mismatched package name.
2. The cache `this.gitPath` would be incorrect for local packages. My fix was to always use the `this.gitUrl` to generate the cache path. This ensures that `bower install jquery`, `bower install git://github.com/components/jquery.git` and a local install of `jquery` always generate the same cache directory for update checks. Fixes some previous issues I had with `bower list`. See the `Package#cacheName` property.
3. Locking issues with `unitWork`. `unitWork` always uses the consistent `cacheName` identifier.

/cc @satazor @sindresorhus