Merge pull request #22 from thecesrom/fix/init_test

fix: update strategy for detecting top-level directory
This commit is contained in:
Bhupesh Varshney 2022-02-18 11:44:18 +05:30 committed by GitHub
commit 8071a762f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

2
ugit
View file

@ -394,7 +394,7 @@ init_test() {
# test if user is in a git directory or not
if git rev-parse --git-dir > /dev/null 2>&1; then
# check if the current working directory is top level or not
[ "$(pwd)" != "$(git rev-parse --show-toplevel)" ] && printf "ugit: %s\n" "Not inside top level dir $(git rev-parse --show-toplevel)"
[ "" != "$(git rev-parse --show-cdup)" ] && printf "ugit: %s\n" "Not inside top level dir $(git rev-parse --show-toplevel)"
else
printf "%s\n" "Ummm, you are not inside a Git repo 😟"
exit