@@ -267,7 +267,7 @@ one from the minibuffer, and move to the next line."
267
267
(" Z" " Redo" magit-stgit-redo-popup)]]
268
268
[" Patch"
269
269
[(" N" " New" magit-stgit-new)
270
- (" g" " Refresh" magit-stgit-refresh-popup )
270
+ (" g" " Refresh" magit-stgit-refresh)
271
271
(" RET" " Show" magit-stgit-show)]
272
272
[(" e" " Edit" magit-stgit-edit)
273
273
(" n" " Rename" magit-stgit-rename)
@@ -438,28 +438,31 @@ one from the minibuffer."
438
438
(interactive (transient-args 'magit-stgit-uncommit ))
439
439
(magit-run-stgit " uncommit" args))
440
440
441
- (magit-define-popup magit-stgit-refresh-popup
442
- " Popup console for StGit refresh."
443
- 'magit-stgit-commands
444
- :switches '((?u " Only update the current patch files" " --update" )
445
- (?i " Refresh from index instead of worktree" " --index" )
446
- (?F " Force refresh even if index is dirty" " --force" )
447
- (?e " Edit the patch description" " --edit" )
448
- (?s " Add \" Signed-off-by:\" line" " --sign" )
449
- (?a " Add \" Acked-by:\" line" " --ack" ))
450
- :actions '((?g " Refresh" magit-stgit-refresh))
451
- :default-action #'magit-stgit-refresh )
441
+ (transient-define-prefix magit-stgit-refresh ()
442
+ " Include the latest changes into a patch."
443
+ :man-page " stg-refresh"
444
+ [" Arguments"
445
+ (" -u" " Only update the current patch files" " --update" )
446
+ (" -i" " Refresh from index instead of worktree" " --index" )
447
+ (" -F" " Force refresh even if index is dirty" " --force" )
448
+ (" -e" " Edit the patch description" " --edit" )
449
+ (" -s" " Add Signed-off-by" " --sign" )
450
+ (" -a" " Add Acked-by" " --ack" )]
451
+ [" Actions"
452
+ (" g" " Refresh" magit-stgit--refresh)])
452
453
453
454
;;;### autoload
454
- (defun magit-stgit-refresh (&optional patch &rest args )
455
- " Refresh StGit patch PATCH.
456
- Use ARGS to pass additional arguments."
457
- (interactive (list (magit-stgit-read-patches nil nil t nil " Refresh patch (default top)" )
458
- (magit-stgit-refresh-arguments)))
459
- (setq patch (nth 0 patch))
460
- (when patch
461
- (setq args (append args (list (format " --patch=%s " patch)))))
462
- (magit-run-stgit-async " refresh" args))
455
+ (defun magit-stgit--refresh (&optional patch &rest args )
456
+ " Invoke `stg refresh --patch PATCH ARGS...'.
457
+
458
+ If PATCH is nil, refresh the current patch.
459
+
460
+ If called interactively, refresh the patch at point or read one
461
+ from the minibuffer."
462
+ (interactive (cons (car (magit-stgit-read-patches
463
+ nil nil t t " Refresh patch" ))
464
+ (transient-args 'magit-stgit-refresh )))
465
+ (magit-run-stgit-async " refresh" (and patch (list " --patch" patch)) args))
463
466
464
467
;;;### autoload
465
468
(defun magit-stgit-repair ()
@@ -694,7 +697,7 @@ the To, Cc, and Bcc fields for all patches."
694
697
[" Sink patch" magit-stgit-sink
695
698
:help " Sink StGit patch deeper down the stack" ]
696
699
" ---"
697
- [" Refresh patch" magit-stgit-refresh-popup
700
+ [" Refresh patch" magit-stgit-refresh
698
701
:help " Refresh the contents of a patch in an StGit series" ]
699
702
[" Repair" magit-stgit-repair
700
703
:help " Repair StGit metadata if branch was modified with git commands" ]
0 commit comments