2012-05-06 17:40:11 +00:00
|
|
|
#
|
2012-10-02 02:48:13 +00:00
|
|
|
# Displays the path to the Git directory.
|
2012-05-06 17:40:11 +00:00
|
|
|
#
|
|
|
|
# Authors:
|
|
|
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
|
|
|
#
|
|
|
|
|
2017-07-06 23:01:26 +00:00
|
|
|
# function git-dir {
|
|
|
|
|
2018-03-05 08:56:25 +00:00
|
|
|
local git_dir="${$(command git rev-parse --git-dir):A}"
|
2012-05-06 17:40:11 +00:00
|
|
|
|
|
|
|
if [[ -n "$git_dir" ]]; then
|
|
|
|
print "$git_dir"
|
|
|
|
return 0
|
2012-09-30 03:37:28 +00:00
|
|
|
else
|
2012-09-30 19:30:18 +00:00
|
|
|
print "$0: not a repository: $PWD" >&2
|
2012-09-30 03:37:28 +00:00
|
|
|
return 1
|
2012-05-06 17:40:11 +00:00
|
|
|
fi
|
2017-07-06 23:01:26 +00:00
|
|
|
|
|
|
|
# }
|