Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion bin/git-root
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down