Repository: pypa/pipenv

Issue:
Pipenv fails to install from github by ref and tag
Trying to install from github using ref and tag fails, because pipenv "destroys" the format of the url removing `git:` from the reference.

##### Describe your environment

1. OS Type OSX 10.12.6
1. Python version: `$ python -V` 3.6.3
1. Pipenv version: `$ pipenv --version` 8.3.2

##### Expected result

The reference in `Pipfile` looks like this (which is correct)
`pytest-tags = {git = "git://github.com/Projectplace/pytest-tags.git", editable = true, ref = "1.5"}`

But in the `Pipfile.lock` file, it's
`"git": "//github.com/Projectplace/pytest-tags.git"`

Workaround is to re-add `git:` to the pipfile.lock manually.

##### Actual result

```Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (24ab2e)!
Installing dependencies from Pipfile.lock (24ab2e)…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 19/19 — 00:00:05
An error occurred while installing -e git+//github.com/Projectplace/pytest-tags.git@c8cf057c03a1fa30769c0328efa41d4826e03bcf#egg=pytest-tags! Will try again.
Installing initially–failed dependencies…
Obtaining pytest-tags from git+//github.com/Projectplace/pytest-tags.git@c8cf057c03a1fa30769c0328efa41d4826e03bcf#egg=pytest-tags
  Cloning github.com/Projectplace/pytest-tags.git (to c8cf057c03a1fa30769c0328efa41d4826e03bcf) to /Users/jimbrannlund/.local/share/virtualenvs/dpo-automation-NuB7OARD/src/pytest-tags
fatal: repository 'github.com/Projectplace/pytest-tags.git' does not exist

Command "git clone -q github.com/Projectplace/pytest-tags.git /Users/jimbrannlund/.local/share/virtualenvs/dpo-automation-NuB7OARD/src/pytest-tags" failed with error code 128 in None```




Discussion:
@BeyondEvil I can reproduce this for editable installs, will look into it

Resolving patch:
diff --git a/pipenv/utils.py b/pipenv/utils.py
--- a/pipenv/utils.py
+++ b/pipenv/utils.py
@@ -661,7 +661,9 @@ def convert_deps_from_pip(dep):
             req.path = None
 
         # Crop off the git+, etc part.
-        dependency.setdefault(req.name, {}).update({req.vcs: req.uri[len(req.vcs) + 1:]})
+        if req.uri.startswith('{0}+'.format(req.vcs)):
+            req.uri = req.uri[len(req.vcs) + 1:]
+        dependency.setdefault(req.name, {}).update({req.vcs: req.uri})
 
         # Add --editable, if it's there.
         if req.editable:


Test patch:
diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py
--- a/tests/test_pipenv.py
+++ b/tests/test_pipenv.py
@@ -537,6 +537,19 @@ def test_specific_package_environment_markers(self):
             c = p.pipenv('run python -c "import requests;"')
             assert c.return_code == 1
 
+    @pytest.mark.install
+    @pytest.mark.vcs
+    @pytest.mark.tablib
+    def test_install_editable_git_tag(self):
+        with PipenvInstance() as p:
+            c = p.pipenv('install -e git+git://github.com/kennethreitz/tablib.git@v0.12.1#egg=tablib')
+            assert c.return_code == 0
+            assert 'tablib' in p.pipfile['packages']
+            assert 'tablib' in p.lockfile['default']
+            assert 'git' in p.lockfile['default']['tablib']
+            assert p.lockfile['default']['tablib']['git'] == 'git://github.com/kennethreitz/tablib.git'
+            assert 'ref' in p.lockfile['default']['tablib']            
+
     @pytest.mark.run
     @pytest.mark.alt
     @pytest.mark.install