Fix #2401: erroneous git ref display in eshell prompt

This commit is contained in:
Henrik Lissner 2020-01-23 01:59:20 -05:00
parent 1e91c04c04
commit 1f04bc919f
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -12,11 +12,16 @@
(defun +eshell--current-git-branch () (defun +eshell--current-git-branch ()
;; TODO Refactor me
(cl-destructuring-bind (status . output) (cl-destructuring-bind (status . output)
(doom-call-process "git" "name-rev" "--name-only" "HEAD") (doom-call-process "git" "symbolic-ref" "-q" "--short" "HEAD")
(if (equal status 0) (if (equal status 0)
(format " [%s]" output) (format " [%s]" output)
""))) (cl-destructuring-bind (status . output)
(doom-call-process "git" "describe" "--all" "--always" "HEAD")
(if (equal status 0)
(format " [%s]" output)
"")))))
;;;###autoload ;;;###autoload
(defun +eshell-default-prompt-fn () (defun +eshell-default-prompt-fn ()