diff options
author | Tassilo Horn <tsdh@gnu.org> | 2020-06-15 08:56:11 +0200 |
---|---|---|
committer | Tassilo Horn <tsdh@gnu.org> | 2020-06-15 08:56:11 +0200 |
commit | 2e80328ba683e6205cd65bd3fb69da2563183e66 (patch) | |
tree | 502f9c2c403f784b3d73c2da47e291eef1f2e4ac /lisp/vc/vc-git.el | |
parent | 4f92cf14f395577572d451c0488ade952bc3cbaa (diff) | |
download | emacs-2e80328ba683e6205cd65bd3fb69da2563183e66.tar.gz |
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.
Diffstat (limited to 'lisp/vc/vc-git.el')
-rw-r--r-- | lisp/vc/vc-git.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 261e4c7aa47..636f9dfd0ca 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -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 |