mirror of
https://github.com/Bhupesh-V/ugit.git
synced 2026-09-10 07:26:20 -04:00
Merge pull request #22 from thecesrom/fix/init_test
fix: update strategy for detecting top-level directory
This commit is contained in:
commit
8071a762f4
2
ugit
2
ugit
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue