From e06095e36ff3f21ff3f86772e85595214447797b Mon Sep 17 00:00:00 2001 From: matijs Date: Sat, 17 Oct 2026 15:46:25 +0200 Subject: [PATCH] Improve r() function Do not rely on the git alias to be available and fail silently when not in a git repo. --- .config/shell/funcs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/shell/funcs b/.config/shell/funcs index 47f09ba..f1a96fa 100644 --- a/.config/shell/funcs +++ b/.config/shell/funcs @@ -21,7 +21,9 @@ dot() { } r() { - cd "$(git root)" + local git_root + git_root=$(git rev-parse --show-toplevel 2>/dev/null) || return 1 + cd -- "${git_root}" } git() {