Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-08-07 11:00:46 +0200
committerErich Eckner <git@eckner.net>2019-08-07 11:00:46 +0200
commite18dcc7f2b6f75ff2caea1d9b6fa25e968b1718a (patch)
tree71608745cb650e4228310d4b8894d1b3d5da8ccb /bin
parent8b3300ebba5e6e74998633efca68a76763d609f1 (diff)
bin/nit-picker: re-fetch HEAD before complaining
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nit-picker26
1 files changed, 21 insertions, 5 deletions
diff --git a/bin/nit-picker b/bin/nit-picker
index 1dea301..647bfca 100755
--- a/bin/nit-picker
+++ b/bin/nit-picker
@@ -163,11 +163,27 @@ while pgrep -x ii >/dev/null \
fi
# shellcheck disable=SC2154
if ! git -C "${git_dir}" merge-base --is-ancestor "${git_rev}" "${git_head}" 2> /dev/null; then
- printf 'commit %s is not an ancestor of HEAD %s in repository %s\n' \
- "${git_rev}" \
- "${git_head}" \
- "${git_repo}" \
- | irc_say
+ current_git_head=$(
+ # shellcheck disable=SC2016
+ {
+ printf 'SELECT DISTINCT'
+ printf ' `git_repositories`.`head`'
+ printf ' FROM `git_repositories`'
+ printf ' WHERE `git_repositories`.`name`=from_base64("%s");\n' \
+ "$(
+ printf '%s' "${git_repo}" \
+ | base64 -w0
+ )"
+ } \
+ | mysql_run_query
+ )
+ if ! git -C "${git_dir}" merge-base --is-ancestor "${git_rev}" "${current_git_head}" 2> /dev/null; then
+ printf 'commit %s is not an ancestor of HEAD %s in repository %s\n' \
+ "${git_rev}" \
+ "${current_git_head}" \
+ "${git_repo}" \
+ | irc_say
+ fi
fi
;;
'binary-dependencies')