diff --git a/contrib/scripts/find-backports b/contrib/scripts/find-backports index c9ec1c0d64..ac1bac69bf 100755 --- a/contrib/scripts/find-backports +++ b/contrib/scripts/find-backports @@ -43,6 +43,15 @@ def _keys_to_dict(itr): return d +@memoize +def git_ref_exists_plain(ref): + try: + subprocess.check_output(["git", "show-ref", "-q", "--verify", str(ref)]) + except subprocess.CalledProcessError: + return False + return True + + @memoize def git_ref_exists(ref): try: @@ -245,6 +254,11 @@ if __name__ == "__main__": if not ref_head: die('Ref "%s" does not exist' % (ref_head0)) + if not git_ref_exists_plain("refs/notes/bugs"): + die( + "Notes refs/notes/bugs not found. Read CONTRIBUTING.md file for how to setup the notes" + ) + ref_upstreams = [] if len(sys.argv) <= 2: head_name = git_get_head_name(ref_head0)