mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-03-11 01:01:11 -07:00
Some were outdated, some were incorrectly labeled, others were already completed, some were missing... Gotta fix them all. Also, in :ui hl-todo, there are comments that describe how Doom uses each of these annotations; those have been updated.
16 lines
505 B
EmacsLisp
16 lines
505 B
EmacsLisp
;;; lisp/lib/git.el -*- lexical-binding: t; -*-
|
|
;;; Commentary:
|
|
;;; Code:
|
|
|
|
;;;###autoload
|
|
(defun doom-git-toplevel (&rest segments)
|
|
"Return the path to the current repo's root."
|
|
(cl-destructuring-bind (code . output)
|
|
(doom-call-process "git" "rev-parse" "--show-toplevel")
|
|
(if (zerop code)
|
|
(apply #'file-name-concat output segments)
|
|
;; TODO: throw stderr as error
|
|
(user-error "Not in a git repo: %s" default-directory))))
|
|
|
|
(provide 'doom-lib '(git))
|
|
;;; git.el ends here
|