Skip to contentSkip to conversation

git.el: Refresh only the changed file marks when marking/unmarking all.

PATCH New Alexandre Julliard 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git.el: Refresh only the changed file marks when marking/unmarking all.

---
 contrib/emacs/git.el |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
contrib/emacs/git.el +5 -2
index 0e5091c..e5ee8ce 100644
@@ -842,7 +842,8 @@ Return the list of files that haven't been handled."
   "Mark all files."
   (interactive)
   (unless git-status (error "Not in git-status buffer."))
-  (ewoc-map (lambda (info) (setf (git-fileinfo->marked info) t) t) git-status)
+  (ewoc-map (lambda (info) (unless (git-fileinfo->marked info)
+                             (setf (git-fileinfo->marked info) t))) git-status)
   ; move back to goal column after invalidate
   (when goal-column (move-to-column goal-column)))
 
@@ -850,7 +851,9 @@ Return the list of files that haven't been handled."
   "Unmark all files."
   (interactive)
   (unless git-status (error "Not in git-status buffer."))
-  (ewoc-map (lambda (info) (setf (git-fileinfo->marked info) nil) t) git-status)
+  (ewoc-map (lambda (info) (when (git-fileinfo->marked info)
+                             (setf (git-fileinfo->marked info) nil)
+                             t)) git-status)
   ; move back to goal column after invalidate
   (when goal-column (move-to-column goal-column)))
 
Signature · 5 lines
1.5.3.4.404.g5a866

-- 
Alexandre Julliard
[email protected]