diff options
author | Daniel Hahler <git@thequod.de> | 2019-06-09 16:13:06 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-06-09 16:13:06 +0200 |
commit | b74da2ff3e2d39eef848355edabefbce28972ecd (patch) | |
tree | b118e5381965fb9d956ffa84518ccac971697522 /scripts/vim-patch.sh | |
parent | a2bb63c182bfb5b2f4888d9528cb25490b3de41f (diff) | |
download | rneovim-b74da2ff3e2d39eef848355edabefbce28972ecd.tar.gz rneovim-b74da2ff3e2d39eef848355edabefbce28972ecd.tar.bz2 rneovim-b74da2ff3e2d39eef848355edabefbce28972ecd.zip |
vim-patch.sh: git-for-each-ref: use strip [ci skip] #10169
- It is a synonym for lstrip, which works with older Git versions also
(2.7.4, Ubuntu Xenial).
- exit in case of errors from git-foreach-ref
- msg_err: echo to stderr
Ref: https://github.com/neovim/neovim/pull/10165#issuecomment-500164356
Diffstat (limited to 'scripts/vim-patch.sh')
-rwxr-xr-x | scripts/vim-patch.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index 43af437c2b..d16266dd36 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -41,7 +41,7 @@ msg_ok() { } msg_err() { - printf '\e[31m✘\e[0m %s\n' "$@" + printf '\e[31m✘\e[0m %s\n' "$@" >&2 } # Checks if a program is in the user's PATH, and is executable. @@ -393,10 +393,15 @@ list_missing_vimpatches() { # Create an associative array mapping Vim commits to tags. eval "declare -A vim_commit_tags=( $(git -C "${VIM_SOURCE_DIR}" for-each-ref refs/tags \ - --format '[%(objectname)]=%(refname:lstrip=2)' \ + --format '[%(objectname)]=%(refname:strip=2)' \ --sort='-*authordate' \ --shell) )" + # Exit in case of errors from the above eval (empty vim_commit_tags). + if ! (( "${#vim_commit_tags[@]}" )); then + msg_err "Could not get Vim commits/tags." + exit 1 + fi # Get missing Vim commits for vim_commit in $(list_vim_commits); do |