aboutsummaryrefslogtreecommitdiff
path: root/lisp/magit-git.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2026-02-03 08:55:28 +0100
committerJonas Bernoulli <jonas@bernoul.li>2026-02-03 08:55:28 +0100
commitf55bfaf7926d81f0118c2e2760ab87ba0aeee937 (patch)
treec9c5683f27f9e875b57e0b825709ea8a2dfa3659 /lisp/magit-git.el
parentcd49010cb303f63b5fb4e00baa64c40eebd05736 (diff)
Set new magit-blob-oid in blob buffers and only refresh if necessary
Diffstat (limited to 'lisp/magit-git.el')
-rw-r--r--lisp/magit-git.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index b41d07b..d3dbca0 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -1331,6 +1331,11 @@ Sorted from longest to shortest CYGWIN name."
;;; Blobs
+(defun magit-blob-oid (rev file)
+ (if (equal rev "{index}")
+ (cadr (car (magit--file-index-stages file)))
+ (magit-git-string "ls-tree" "--object-only" rev "--" file)))
+
(defun magit--file-index-stages (file)
(mapcar (##split-string % " ")
(magit-git-lines "ls-files" "--stage" "--" file)))