diff options
author | James McCoy <jamessan@jamessan.com> | 2018-08-20 11:41:00 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-08-20 17:41:00 +0200 |
commit | c05d7153d3158877510b9490247751127b6af813 (patch) | |
tree | f31eebaa2c42a51a450d26a6aa82acc6e3a5ed1e /scripts/vim-patch.sh | |
parent | 98632f1cce66e5dd82c17f7a8da6e447b32fc962 (diff) | |
download | rneovim-c05d7153d3158877510b9490247751127b6af813.tar.gz rneovim-c05d7153d3158877510b9490247751127b6af813.tar.bz2 rneovim-c05d7153d3158877510b9490247751127b6af813.zip |
vim-patch.sh: Use git-rev-parse to check repo (#8875)
Explicitly checking for the .git/ directory doesn't work in various
situations (e.g., git-worktree).
[ci skip]
Diffstat (limited to 'scripts/vim-patch.sh')
-rwxr-xr-x | scripts/vim-patch.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index 6dd411a34e..9ea43383b6 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -85,12 +85,12 @@ get_vim_sources() { git clone https://github.com/vim/vim.git "${VIM_SOURCE_DIR}" cd "${VIM_SOURCE_DIR}" else - if [[ ! -d "${VIM_SOURCE_DIR}/.git" ]]; then + cd "${VIM_SOURCE_DIR}" + if [[ "$(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 fi - cd "${VIM_SOURCE_DIR}" echo "Updating Vim sources: ${VIM_SOURCE_DIR}" git pull && msg_ok "Updated Vim sources." || @@ -202,7 +202,7 @@ get_vimpatch() { printf "Pre-processing patch...\n" preprocess_patch "${NVIM_SOURCE_DIR}/${patch_file}" - msg_ok "Saved patch to '${NVIM_SOURCE_DIR}/${patch_file}'.\n" + msg_ok "Saved patch to '${NVIM_SOURCE_DIR}/${patch_file}'." } stage_patch() { |