From c8109d0518aa99db2d53da4c2510932a729a31cd Mon Sep 17 00:00:00 2001 From: TEC Date: Wed, 13 Mar 2024 02:15:02 +0800 Subject: [PATCH] Fix edge case in magit forge remote prompt Sometimes (doom-project-root) can return nil --- config.org | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/config.org b/config.org index 83c6f37..4cb22db 100644 --- a/config.org +++ b/config.org @@ -3729,9 +3729,11 @@ the pre-filled remote url use ssh. :filter-args #'magit-remote-add (interactive (let ((default-name - (subst-char-in-string ?\s ?- - (file-name-nondirectory - (directory-file-name (doom-project-root)))))) + (subst-char-in-string + ?\s ?- + (file-name-nondirectory + (directory-file-name + (or (doom-project-root) default-directory)))))) (or (and +magit-default-forge-remote (not (magit-list-remotes)) (eq (read-char-choice