aboutsummaryrefslogtreecommitdiff
path: root/lisp/magit-git.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2025-01-07 07:41:43 +0100
committerJonas Bernoulli <jonas@bernoul.li>2025-01-07 07:41:43 +0100
commitbb89386d984053e26e03bbef6020558ec68185fe (patch)
treef016b10857009a38d5793bf43706304a6437cf8e /lisp/magit-git.el
parent41ea0ff32d0f454f07811cbdb9af62b5cbbf68b0 (diff)
magit-file-relative-name: Remove special handling of indirect buffers
The removed handling was added when this function was first added in [1: 9ca3a8df92], but since we do not do the same anywhere else it is hard to imagine that this actually ever makes something work that otherwise would not work. 1: 2013-09-02 9ca3a8df9295ec957a3c0ac4f49274554d4d156b add magit-buffer-file-name
Diffstat (limited to 'lisp/magit-git.el')
-rw-r--r--lisp/magit-git.el12
1 files changed, 5 insertions, 7 deletions
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index f60c5d5..c529518 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -1022,13 +1022,11 @@ If the file is not inside a Git repository, then return nil.
If TRACKED is non-nil, return the path only if it matches a
tracked file."
- (and-let* ((file (with-current-buffer (or (buffer-base-buffer)
- (current-buffer))
- (or file
- magit-buffer-file-name
- buffer-file-name
- (and (derived-mode-p 'dired-mode)
- default-directory))))
+ (and-let* ((file (or file
+ magit-buffer-file-name
+ buffer-file-name
+ (and (derived-mode-p 'dired-mode)
+ default-directory)))
((or (not tracked)
(magit-file-tracked-p (file-relative-name file))))
(dir (magit-toplevel