1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Add optional remote-name argument to VC repository-url command

* lisp/vc/vc.el: Document new remote-name argument of VC
repository-url command.
* lisp/vc/vc-git.el (vc-git-repository-url): Add and use new arg.
* lisp/vc/vc-hg.el (vc-hg-repository-url): Add and use new arg.
* lisp/vc/vc-bzr.el (vc-bzr-repository-url): Add new arg but ignore
it.
* lisp/vc/vc-svn.el (vc-svn-repository-url): Add new arg but ignore
it.
This commit is contained in:
Tassilo Horn 2020-06-15 08:56:11 +02:00
parent 4f92cf14f3
commit 2e80328ba6
5 changed files with 13 additions and 8 deletions

View file

@ -1083,10 +1083,11 @@ This prompts for a branch to merge from."
"DU" "AA" "UU"))
(push (expand-file-name file directory) files)))))))
(defun vc-git-repository-url (file-or-dir)
(defun vc-git-repository-url (file-or-dir &optional remote-name)
(let ((default-directory (vc-git-root file-or-dir)))
(with-temp-buffer
(vc-git-command (current-buffer) 0 nil "remote" "get-url" "origin")
(vc-git-command (current-buffer) 0 nil "remote" "get-url"
(or remote-name "origin"))
(buffer-substring-no-properties (point-min) (1- (point-max))))))
;; Everywhere but here, follows vc-git-command, which uses vc-do-command