Skip to content

Draft: Trigger push rules for the first push

Vasilii Iakliushin requested to merge 356094_fix_push_rules_for_first_push into master

What does this MR do and why?

Contributes to #356094 (closed)

Problem

On Gitaly side we use git diff-tree to access list of changed paths. It tries to detect diff between provided commit and its parent. But during the first push, the commit doesn't have a parent, because of that git diff-tree returns an empty result.

Solution

To correctly access a list of changed files for the first commit we should provide a special empty tree id that exists for every repository.

We also need to use a different request because we compare tree objects instead of commit objects.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports