diff options
Diffstat (limited to 'lisp/forgejo-vc.el')
| -rw-r--r-- | lisp/forgejo-vc.el | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/forgejo-vc.el b/lisp/forgejo-vc.el index 5d76dd7..02c3f1d 100644 --- a/lisp/forgejo-vc.el +++ b/lisp/forgejo-vc.el @@ -337,11 +337,18 @@ With prefix arg FORCE-PUSH-P, force-push to update an existing PR." (target (if (string-match "\\`\\([^/]+\\)/\\(.+\\)\\'" choice) (match-string 2 choice) choice))) - (list remote - (let ((input (read-string (format "Topic (default: %s): " branch)))) - (if (string-empty-p input) branch input)) - target - current-prefix-arg))) + (let* ((pr-branch-p (string-match-p "\\`pr-[0-9]+\\'" branch)) + (default-topic (unless pr-branch-p branch))) + (list remote + (if default-topic + (let ((input (read-string (format "Topic (default: %s): " default-topic)))) + (if (string-empty-p input) default-topic input)) + (let ((input (read-string "Topic: "))) + (when (string-empty-p input) + (user-error "Topic is required for pr-N branches")) + input)) + target + current-prefix-arg)))) (let ((target (replace-regexp-in-string "\\`.+/" "" target))) (if force-push-p (forgejo-vc--git-push |
