diff options
author | Erich Eckner <git@eckner.net> | 2019-08-07 11:00:46 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-08-07 11:00:46 +0200 |
commit | e18dcc7f2b6f75ff2caea1d9b6fa25e968b1718a (patch) | |
tree | 71608745cb650e4228310d4b8894d1b3d5da8ccb /bin | |
parent | 8b3300ebba5e6e74998633efca68a76763d609f1 (diff) | |
download | builder-e18dcc7f2b6f75ff2caea1d9b6fa25e968b1718a.tar.xz |
bin/nit-picker: re-fetch HEAD before complaining
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/nit-picker | 26 |
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') |