diff options
author | Jesse Luehrs <doy@tozt.net> | 2023-09-17 10:57:46 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2023-09-17 10:57:46 -0400 |
commit | e727e366d386cb49590c2c65969817f89583656a (patch) | |
tree | 29c8caaef2c086235dcca67312deda5ec944c0e9 /config/sh/functions | |
parent | df52f6786a48db5045b89bdccb512b2492098e5e (diff) | |
download | conf-e727e366d386cb49590c2c65969817f89583656a.tar.gz conf-e727e366d386cb49590c2c65969817f89583656a.zip |
factor out finding the git root
Diffstat (limited to 'config/sh/functions')
-rw-r--r-- | config/sh/functions | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/config/sh/functions b/config/sh/functions index 76db947..b64c4cf 100644 --- a/config/sh/functions +++ b/config/sh/functions @@ -8,13 +8,7 @@ function perldoc { } function cdu { - local root - root="$(git rev-parse --show-superproject-working-tree 2>/dev/null)" - if [ -n "$root" ]; then - cd "$root" || return - else - cd "$(git rev-parse --show-toplevel)" || return - fi + cd "$(git root)" || return } # vim:ft=sh: |