Signed-off-by: Gustav Hållberg <gustav@virtutech.com>
(defun stgit-refresh (&optional arg)
"Run stg refresh.
+If the index contains any changes, only refresh from index.
+
With prefix argument, refresh the marked patch or the patch under point."
(interactive "P")
(let ((patchargs (if arg
(t
(cons "-p" patches))))
nil)))
+ (unless (stgit-index-empty-p)
+ (setq patchargs (cons "--index" patchargs)))
(stgit-capture-output nil
(apply 'stgit-run "refresh" patchargs))
(stgit-refresh-git-status))