Fix misleading retry message when GET_SOURCES_ATTEMPTS=1

What does this MR do?

Fix misleading retry message when GET_SOURCES_ATTEMPTS=1

When GET_SOURCES_ATTEMPTS is set to 1 (the default), the runner would print "Retrying in 5s" even though no retry would occur. This was confusing for users.

This change ensures the retry message is only printed when there are actually more attempts remaining (i.e., attempt < attempts-1).

Tests are generated by AI, please review carefully 😉

Fixes GitLab Runner Fetch Repository doesn't retry by... (#39116 - closed)

Why was this MR needed?

What's the best way to test this MR?

Run Unit tests

What are the relevant issue numbers?

Edited by Adebayo Adesanya

Merge request reports

Loading