Tags: patch In a clone of https://github.com/abo-abo/swiper.git, with the following remotes: $ git remote -v elpa savannah:/srv/git/emacs/elpa.git (fetch) elpa savannah:/srv/git/emacs/elpa.git (push) origin git@github.com:basil-conto/swiper.git (fetch) origin git@github.com:basil-conto/swiper.git (push) upstream git@github.com:abo-abo/swiper.git (fetch) upstream git@github.com:abo-abo/swiper.git (push) 0. emacs -Q ivy.el 1. M-: (vc-call-backend 'Git 'repository-url "upstream") RET This returns: "git@github.com:basil-conto/swiper.git" instead of: "git@github.com:abo-abo/swiper.git" Step 1 is effectively what bug-reference-try-setup-from-vc does, and I believe the incorrect result is due to vc-git-repository-url expecting a file name, not a Git remote name, as its first argument. How's the attached fix?