feat: add ghpr-list-prs
This commit is contained in:
parent
28e18f7ecb
commit
30cfe3b7f3
4 changed files with 122 additions and 1 deletions
10
ghpr-repo.el
10
ghpr-repo.el
|
@ -31,6 +31,16 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
(require 'magit)
|
||||
|
||||
(defun ghpr--get-repo-name ()
|
||||
"Get the GitHub repository name in owner/repo format from origin remote.
|
||||
Returns nil if origin remote doesn't exist or is not a GitHub repository."
|
||||
(when (magit-remote-p "origin")
|
||||
(let ((origin-url (magit-get "remote.origin.url")))
|
||||
(when (string-match "github\\.com[:/]\\([^/]+/[^/.]+\\)" origin-url)
|
||||
(match-string 1 origin-url)))))
|
||||
|
||||
(provide 'ghpr-repo)
|
||||
|
||||
;;; ghpr-repo.el ends here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue