The capital Y in the prompt means a default value for if you press enter. Maybe pull the prompt, read, and result check into a helper function? It should probably loop like `git add --patch`’s prompt does on unknown input.