[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit 4b8eab3af1 3/3: magit-{branch-or, }commit-at-po
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit 4b8eab3af1 3/3: magit-{branch-or, }commit-at-point: Only use blame chunk when blaming |
Date: |
Fri, 27 May 2022 06:58:24 -0400 (EDT) |
branch: elpa/git-commit
commit 4b8eab3af130c47421482c1d28c1cbcb033106fc
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
magit-{branch-or,}commit-at-point: Only use blame chunk when blaming
`magit-current-blame-chunk' also returns a commit when
`magit-blame-mode' isn't turned on, but in such situations defaulting
to the commit that last modified the current line isn't exactly dwim.
Closes #4697.
---
lisp/magit-git.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index 6c6630c748..26636fbd4b 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -1513,7 +1513,8 @@ to, or to some other symbolic-ref that points to the same
ref."
(defun magit-commit-at-point ()
(or (magit-section-value-if 'commit)
(magit-thing-at-point 'git-revision t)
- (and-let* ((chunk (and (fboundp 'magit-current-blame-chunk)
+ (and-let* ((chunk (and (bound-and-true-p magit-blame-mode)
+ (fboundp 'magit-current-blame-chunk)
(magit-current-blame-chunk 'addition t))))
(oref chunk orig-rev))
(and (derived-mode-p 'magit-stash-mode
@@ -1534,7 +1535,8 @@ to, or to some other symbolic-ref that points to the same
ref."
(magit-ref-p (format "refs/pullreqs/%s"
(oref (oref it value) number))))))
(magit-thing-at-point 'git-revision t)
- (and-let* ((chunk (and (fboundp 'magit-current-blame-chunk)
+ (and-let* ((chunk (and (bound-and-true-p magit-blame-mode)
+ (fboundp 'magit-current-blame-chunk)
(magit-current-blame-chunk 'addition t))))
(oref chunk orig-rev))
(and magit-buffer-file-name