Skip to content

Fix snippet commit bug because of different Gitaly error

What does this MR do?

In gitaly!3061 (merged) we've moved to the new Go port of the UserCommitFiles operation. In this version, it seems it doesn't return IndexError for some invalid paths, in specific, paths like .git/hooks/pre-commit, that returns CommandError.

This breaks spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb, that tests that in particular, but it also would break any snippet commit operation where the user tries to commit to a file like that.

This MR fixes that bug by catching the new kind of error.

Refs #322096 (closed)

Does this MR meet the acceptance criteria?

Conformity

Related to #322096 (closed)

Edited by Francisco Javier López

Merge request reports

Loading