Function: magit-parent-status

magit-parent-status is an interactive and natively compiled function defined in magit-status.el.

Signature

(magit-parent-status)

Documentation

Show the status of the parent repository of the current Git repository.

If the current repository is a submodule, show the status buffer of its super-repository. Otherwise step outside the worktree of the current repository, and if that takes us to another repository, consider that the parent repository.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/irvbdy0zra0dn8fpd008f32x5ix6qm5v-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-20261005.508/magit-status.el
(defun magit-parent-status ()
  "Show the status of the parent repository of the current Git repository.
If the current repository is a submodule, show the status buffer
of its super-repository.  Otherwise step outside the worktree of
the current repository, and if that takes us to another repository,
consider that the parent repository."
  (interactive)
  (cond-let*
    [[topdir (magit-toplevel)]]
    ((not topdir)
     (user-error "Not inside a Git repository"))
    [[gitdir (magit-gitdir)]
     [parent (magit-toplevel (file-name-parent-directory gitdir))]]
    ((and parent (not (file-equal-p parent topdir)))
     (magit-status-setup-buffer parent))
    [[default-directory (file-name-parent-directory topdir)]]
    ([parent (magit-toplevel)]
     (magit-status-setup-buffer parent))
    ((user-error "No parent repository"))))