From a97364bc3d2045f3a485f0ec920e39315a3f7cab Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 29 Aug 2019 10:41:30 +0200 Subject: bin/nit-picker: `git fetch` before complaining about a HEAD not being ahead of some commit --- bin/nit-picker | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'bin/nit-picker') diff --git a/bin/nit-picker b/bin/nit-picker index 562f239..9395ef4 100755 --- a/bin/nit-picker +++ b/bin/nit-picker @@ -191,11 +191,14 @@ while pgrep -x ii >/dev/null \ | 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 + git -C "${git_dir}" fetch --all -p >/dev/null 2>&1 + 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 fi ;; -- cgit v1.2.3