Function: magit-inside-worktree-p

magit-inside-worktree-p is a byte-compiled function defined in magit-git.el.

Signature

(magit-inside-worktree-p &optional NOERROR)

Documentation

Return t if default-directory is below a working directory.

If it is below the repository directory, then return nil. If it isn't below either, then signal an error unless NOERROR is non-nil, in which case return nil.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-git.el
(defun magit-inside-worktree-p (&optional noerror)
  "Return t if `default-directory' is below a working directory.
If it is below the repository directory, then return nil.
If it isn't below either, then signal an error unless NOERROR
is non-nil, in which case return nil."
  (and (magit--assert-default-directory noerror)
       (condition-case nil
           (magit-rev-parse-true "--is-inside-work-tree")
         (magit-invalid-git-boolean
          (and (not noerror)
               (signal 'magit-outside-git-repo default-directory))))))