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:
@ -5,15 +5,18 @@
|
||||
# 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
|
||||
elif [[ "$PWD" != "$(git-root)" ]]; then
|
||||
print "$0: must be run from the root of the work tree" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
local src="$1"
|
||||
local dst="$2"
|
||||
local url
|
||||
|
||||
if [[ "$PWD" != "$(git-root)" ]]; then
|
||||
print "$0: must be run from the root of the working tree" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
url="$(git config --file "$(git-root)/.gitmodules" --get "submodule.${src}.url")"
|
||||
|
||||
if [[ -z "$url" ]]; then
|
||||
|
Reference in New Issue
Block a user