isaacs/npm — pull request #2325 by mfncooper (2012-03-30 22:42:37+00:00)
Title: Fix assignment of repo in init command

In the init command, the code for setting the repo works, but only accidentally. The defaultRepo function constructs the correct repo object, but this is then clobbered and replaced by a string. The processJson function sees that a string has been provided instead of an object, and reconstructs the object again. (You can see the bug in action by temporarily changing the repo type string in defaultRepo; the type will still be "git" when the package.json contents are created.)