From 8872fce120b0d38d50254c82407038d40da84647 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 21 Aug 2018 08:37:49 +0200 Subject: [PATCH] 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 c05d7153d315 --- scripts/vim-patch.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index 9ea43383b6..bba76ffa97 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -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