1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-06-14 10:51:41 +00:00

Make sure that the current directory is a Git repository

This commit is contained in:
Sorin Ionescu
2012-09-30 15:30:18 -04:00
parent 6c1a81b5cf
commit 102da8bea0
12 changed files with 55 additions and 10 deletions

View File

@ -5,6 +5,11 @@
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
print "$0: not a repository work tree: $PWD" >&2
return 1
fi
git fsck 2> /dev/null \
| grep "^dangling commit" \
| awk '{print $3}' \