From e0fd76b04f8364dfa0f602568d6a2257b9c34dab Mon Sep 17 00:00:00 2001 From: James Smith Date: Mon, 8 May 2023 12:08:45 +0200 Subject: [PATCH] Fix logic error in main branch selection I was previously looking at two different lists, `candidates` and `branch_list`. So the numbers weren't matching up. This is fixed now. --- git-tidy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/git-tidy b/git-tidy index 126444c..d865737 100755 --- a/git-tidy +++ b/git-tidy @@ -111,16 +111,17 @@ def get_default_branch() -> str: # If there's no clear default, let the user select which one to use: selection = -1 - while (selection < 0) or (selection >= len(candidates)): + while (selection < 0) or (selection >= len(branch_list)): print("Unable to determine default branch automatically. Please select one:") for n, branch in enumerate(branch_list): print(f"{n}: {branch}") - raw_input = input("Which to choose?") + raw_input = input("Which to choose? ") try: selection = int(raw_input) except ValueError: continue + print(selection) return branch_list[selection]