Skip to content

Ensure .git/config is updated for forks

Stan Hu requested to merge sh-update-git-config-for-forks into master

Normally when a project is created, Projects::CreateService attempts to initialize a Git directory and update the .git/config to include the human-readable project full path (https://gitlab.com/gitlab-org/gitlab/blob/7fbf16ac2e43a5eb3f4207ddbbf739834b01d00c/app/services/projects/create_service.rb#L88). However, for forks and project imports, the repository is imported in a separate background task. As a result, attempts to write to the .git/config directory will fail unless the job has completed first.

To ensure we always update .git/config after the import is complete, we call this update in Project#after_import.

Relates to gitaly#2902 (closed)

Edited by Stan Hu

Merge request reports

Loading