summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-12-12 22:27:56 -0500
committerKyle Meyer <kyle@kyleam.com>2016-12-12 22:37:01 -0500
commitbefb207b48e631b3c5855e12900387e69b03dc5c (patch)
treeddaf5fbf8ed9e6a42f7b20cb3390991bc9d05ab4
parent3f39a58cf419a11ac01f1f9f8fba6919186f9e2b (diff)
downloademacs.d-befb207b48e631b3c5855e12900387e69b03dc5c.tar.gz
git-rebase-fixup-duplicates: Use marker
If only an integer is used, the end value used for the search is no longer accurate because more characters are inserted for each line where "fixup" or "squash" is substituted for "pick". This discrepancy is unlikely to have an observable effect when git-rebase-show-instructions is non-nil because the end value includes many characters beyond the last commit line. But when git-rebase-show-instructions is nil, this can easily result in the last commit line not matching the regexp because the end value has shifted to the middle of the line.
-rw-r--r--lisp/km-magit.el2
1 files changed, 2 insertions, 0 deletions
diff --git a/lisp/km-magit.el b/lisp/km-magit.el
index cba378d..0fae81e 100644
--- a/lisp/km-magit.el
+++ b/lisp/km-magit.el
@@ -655,6 +655,8 @@ If prefix argument SQUASH is non-nil, mark for squashing instead
of fixing up."
(interactive (nconc (km/region-or-buffer-line-bounds)
(list current-prefix-arg)))
+ (unless (markerp end)
+ (setq end (copy-marker end)))
(save-excursion
(goto-char beg)
(let ((prefix (if squash "squash" "fixup"))