mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
git root: show '.' when using with -r in the root dir (#995)
This commit is contained in:
parent
62aa91f221
commit
584e0283f5
|
|
@ -6,7 +6,13 @@ git_root() {
|
|||
|
||||
# get the relative path of current path according to root of repo
|
||||
git_root_relative() {
|
||||
git rev-parse --show-prefix
|
||||
rel=$(git rev-parse --show-prefix)
|
||||
if [ -z "$rel" ]; then
|
||||
# git rev-parse --show-prefix will output empty string when we are in the root dir
|
||||
echo "."
|
||||
else
|
||||
echo "$rel"
|
||||
fi
|
||||
}
|
||||
|
||||
if test $# -eq 0; then
|
||||
|
|
|
|||
Loading…
Reference in a new issue