mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
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]
This commit is contained in:

committed by
Justin M. Keyes

parent
98632f1cce
commit
c05d7153d3
@@ -85,12 +85,12 @@ get_vim_sources() {
|
|||||||
git clone https://github.com/vim/vim.git "${VIM_SOURCE_DIR}"
|
git clone https://github.com/vim/vim.git "${VIM_SOURCE_DIR}"
|
||||||
cd "${VIM_SOURCE_DIR}"
|
cd "${VIM_SOURCE_DIR}"
|
||||||
else
|
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."
|
msg_err "${VIM_SOURCE_DIR} does not appear to be a git repository."
|
||||||
echo " Please remove it and try again."
|
echo " Please remove it and try again."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
cd "${VIM_SOURCE_DIR}"
|
|
||||||
echo "Updating Vim sources: ${VIM_SOURCE_DIR}"
|
echo "Updating Vim sources: ${VIM_SOURCE_DIR}"
|
||||||
git pull &&
|
git pull &&
|
||||||
msg_ok "Updated Vim sources." ||
|
msg_ok "Updated Vim sources." ||
|
||||||
@@ -202,7 +202,7 @@ get_vimpatch() {
|
|||||||
|
|
||||||
cd "${NVIM_SOURCE_DIR}"
|
cd "${NVIM_SOURCE_DIR}"
|
||||||
|
|
||||||
printf "Creating patch...\n"
|
printf "Creating patch...\n"
|
||||||
echo "$patch_content" > "${NVIM_SOURCE_DIR}/${patch_file}"
|
echo "$patch_content" > "${NVIM_SOURCE_DIR}/${patch_file}"
|
||||||
|
|
||||||
printf "Pre-processing patch...\n"
|
printf "Pre-processing patch...\n"
|
||||||
|
Reference in New Issue
Block a user