Add a method to copy the .gitattributes into the bare repository

Added a method which will copy the contents of .gitattributes at the given ref into info/attributes in the bar repository. This will allow Rugged to successfully use the attributes when producing its output.

Works towards a fix for gitlab-org/gitlab-ce#2315

Before this gets merged in:

  • gitlab-org/gitlab-git-test will need to be updated with the two additional branches in matto1990/gitlab-git-test (gitattributes and gitattributes-updated).
  • The 2nd commit should be removed for this branch, leaving the spec/support/seed_helper.rb file unchanged from master.

Some bits I would like feedback on:

  • Is the method in the correct place?
  • Is it acceptable to be writing to the info/attributes file from inside repository.rb? There seems to be another case of files being written in this class in the archive_to_file method.
  • Are the tests in the correct format?
  • Is it ok to be adding and removing the info directory from the test repo? I've added after methods to clean up and the tests seem to be fine, but I wanted to check this was ok.

cc @stanhu @dzaporozhets

Merge request reports

Loading