From: Gustav HÃ¥llberg Date: Thu, 30 Jul 2009 22:57:57 +0000 (+0200) Subject: stgit.el: Refresh from work tree when index is empty X-Git-Tag: v0.15-rc2~11^2~45 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/36a4eacd06b048f04432b8a4d0e36ad478b4ac24?hp=51783171059194286d2baaae3298d8d628a599b0 stgit.el: Refresh from work tree when index is empty Signed-off-by: Gustav HÃ¥llberg --- diff --git a/contrib/stgit.el b/contrib/stgit.el index 9ee353c..c624ecc 100644 --- a/contrib/stgit.el +++ b/contrib/stgit.el @@ -1190,6 +1190,8 @@ With prefix argument, run it with the --hard flag." (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 @@ -1201,6 +1203,8 @@ With prefix argument, refresh the marked patch or the patch under point." (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))