aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2025-10-04 22:28:21 +0200
committerJonas Bernoulli <jonas@bernoul.li>2025-10-04 22:28:21 +0200
commit9bd644a0e97c16e3564d278d0c0889fe1b6badf5 (patch)
tree93ce3b98c3b94f7920799ac94db3ba6fd489e4ab
parentb5066e5fa4000df474e5fb35b417b76d32e8131f (diff)
magit-diff-wash-diff: Also stop when reaching a log heading
A diff may contain just headers and no hunk. When washing a diff directly, we already detected that by checking whether we have reached the beginning of the next diff or eob. When the diff is part of a log, we additionally have to also check whether we have reached the next log heading. Alternatively we could pass along the limit from `magit-log-wash-rev' (as a marker, because we modify the buffer text), but that would complicate matters. Closes #5454.
-rw-r--r--lisp/magit-diff.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index e229a92..86da796 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -2458,7 +2458,9 @@ keymap is the parent of their keymaps."
(rename nil)
(binary nil))
(magit-delete-line)
- (while (not (or (eobp) (looking-at magit-diff-headline-re)))
+ (while (not (or (eobp)
+ (looking-at magit-diff-headline-re)
+ (looking-at magit-log-heading-re)))
(cond
((looking-at "old mode \\(?:[^\n]+\\)\nnew mode \\(?:[^\n]+\\)\n")
(setq modes (match-str 0)))