From b15c0c042cdea746fc19856527d8baf947c3c220 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Thu, 10 Sep 2020 13:32:29 -0700 Subject: [PATCH] fix: don't attempt to create redundant PR to start tracking obsolete files (#755) Check if the branch already exists. --- autosynth/synth.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autosynth/synth.py b/autosynth/synth.py index d12044531..3ef551858 100644 --- a/autosynth/synth.py +++ b/autosynth/synth.py @@ -376,7 +376,9 @@ def synthesize_loop( if not has_changes: if not toolbox.metadata_contains_generated_files( toolbox.branch - ) and toolbox.metadata_contains_generated_files(toolbox.sub_branch(youngest)): + ) and toolbox.metadata_contains_generated_files( + toolbox.sub_branch(youngest) + ) and not change_pusher.check_if_pr_already_exists(toolbox.branch): # Special case: the repo owner turned on obsolete file tracking. # Generate a one-time PR containing only metadata changes. executor.check_call(["git", "checkout", toolbox.branch])