Fix secret push protection IndexError during tree traversal

What does this MR do and why?

Contributes to #571446 (closed)

Problem

Secret push protection was failing with "GRPC::NotFound: 5:invalid revision or path" errors during Git push operations when encountering invalid revisions or paths during tree traversal.

Soluton

Add error handling for Gitlab::Git::Index::IndexError exceptions in the ResponseHandler, allowing the secret detection scan to gracefully handle missing or invalid references without blocking the entire push operation.

References

Secret push protection fails with "invalid revi... (#571446 - closed)

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #571446 (closed)

Merge request reports

Loading