Commit d0e04a14 authored by Jonas Bernoulli's avatar Jonas Bernoulli

magit-reverse-files: do not attempt to reverse binary files

It would not work.  Instead inform the user upfront.
parent 89459e31
......@@ -348,8 +348,13 @@ without requiring confirmation."
section "--reverse"))))
(defun magit-reverse-files (sections)
(when (magit-confirm-files 'reverse (mapcar 'magit-section-value sections))
(mapc 'magit-reverse-apply sections)))
(cl-destructuring-bind (binaries files)
(let ((binaries (magit-staged-binary-files)))
(--separate (member (magit-section-value it) binaries) sections))
(when (magit-confirm-files 'reverse files)
(mapc #'magit-reverse-apply files))
(when binaries
(user-error "Cannot reverse binary files"))))
;;; magit-apply.el ends soon
(provide 'magit-apply)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment