Function: diff-hl-git-index-object-name

diff-hl-git-index-object-name is a natively compiled function defined in diff-hl.el.

Signature

(diff-hl-git-index-object-name FILE)

Source Code

;; Defined in /nix/store/cfz56rl3lp066226i0bmmgiicls3gcq7-emacs-packages-deps/share/emacs/site-lisp/elpa/diff-hl-20261001.135/diff-hl.el
;; TODO: Cache based on .git/index's mtime, maybe.
(defun diff-hl-git-index-object-name (file)
  (with-temp-buffer
    (vc-git-command (current-buffer) 0 file "ls-files" "-s")
    (and
     (goto-char (point-min))
     (re-search-forward "^[0-9]+ \\([0-9a-f]+\\)" nil t)
     (match-string-no-properties 1))))