gmarik/Vundle.vim — pull request #440 by jdevera (2014-04-15 09:49:27+00:00)
Title: Treat changed remotes as new plugins (II)

## What this PR is

This my counter proposal to @URoc327's PR #400
Fixes #367 #48 #183

Based on @aaronjensen's suggestion to use `git fetch && git reset --hard origin/HEAD` instead of `pull`, but with an important distinction: Do it only when the URI in the Vundle config is different to that of the origin remote in the existing repository.

This, in effect, wipes out the old repo and checks out the contents of the new.

As a follow up, we should probably warn the user when they have clashing names in their config, as only the latest one will be valid.

## From the commit message
```
If one had this plugin:

Plugin 'foo/bar'

And now switches to another one with the same name:

Plugin 'baz/bar'

Recognise this scenario and replace the old plugin with the new one,
rather than silently assuming they are the same.
```

## How I tested it

I created a dummy repo:

```sh
mkdir /tmp/Align
cd /tmp/Align
git init .
echo "foo" > foo
git add foo
git ci -m foo
```

The I added these two lines to my vimrc:

```viml
Plugin 'file:///tmp/Align'
Plugin 'Align'
```

I restarted Vim and ran `:VundleInstall` (no need for `!`). I verified that both plugins got a `+` on the installer, that the log mentioned the remote change, and that I could use the `Align` command afterwards.