vim-patch.sh: Also check for .git/ directory

In the case of nested repos, such as when "neovim/" repo contains
"neovim/.vim-src/" repo,
    git rev-parse --show-toplevel
returns the fullpath to the "neovim/" repo, which failed the condition.

ref #8875
ref c05d7153d3
This commit is contained in:
Justin M. Keyes 2018-08-21 08:37:49 +02:00
parent 150b1b7b40
commit 8872fce120

View File

@ -86,7 +86,8 @@ get_vim_sources() {
cd "${VIM_SOURCE_DIR}"
else
cd "${VIM_SOURCE_DIR}"
if [[ "$(git rev-parse --show-toplevel)" != "${VIM_SOURCE_DIR}" ]]; then
if ! [ -d ".git" ] \
&& ! [ "$(git rev-parse --show-toplevel)" = "${VIM_SOURCE_DIR}" ]; then
msg_err "${VIM_SOURCE_DIR} does not appear to be a git repository."
echo " Please remove it and try again."
exit 1