mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 21:25:04 -07:00
build(vim-patch.sh): handle added/removed files properly
This commit is contained in:
parent
c41873ab63
commit
9f6502535b
@ -315,12 +315,11 @@ uncrustify_patch() {
|
|||||||
local before=$patch_path/before/$basename
|
local before=$patch_path/before/$basename
|
||||||
local after=$patch_path/after/$basename
|
local after=$patch_path/after/$basename
|
||||||
local patchfile="$patch_path"/patch/"$basename".patch
|
local patchfile="$patch_path"/patch/"$basename".patch
|
||||||
if [[ ! -e $before ]] || [[ ! -e $after ]]; then
|
[[ ! -e $before ]] && before=/dev/null
|
||||||
continue
|
[[ ! -e $after ]] && after=/dev/null
|
||||||
fi
|
|
||||||
git --no-pager diff --no-index --patch --unified=5 --color=never "$before" "$after" > "$patchfile"
|
git --no-pager diff --no-index --patch --unified=5 --color=never "$before" "$after" > "$patchfile"
|
||||||
sed -E "s|$before|/$file|g" -i "$patchfile"
|
[[ "$before" != /dev/null ]] && sed -E "s|$before|/$file|g" -i "$patchfile"
|
||||||
sed -E "s|$after|/$file|g" -i "$patchfile"
|
[[ "$after" != /dev/null ]] && sed -E "s|$after|/$file|g" -i "$patchfile"
|
||||||
done
|
done
|
||||||
|
|
||||||
cat "$patch_path"/patch/*.patch
|
cat "$patch_path"/patch/*.patch
|
||||||
|
Loading…
Reference in New Issue
Block a user