git: Allow staging untracked directories
This commit refactors vcsPluginForUrl
so that it
- also returns the project (everywhere its used a project is also needed)
- normalizes the passed url by removing any trailing slashes
The second item above makes sure that a project is found even for directories (see also cea7c643 for anoter bug with trailing slashes).