Skip to content

GetArchive: Support path elision

This MR adds bool elide_path = 7 to RepositoryService.GetArchiveRequest. elide_path = false maintains the current behavior; elide_path = true subtly changes how commit_id and path are passed to git archive, which affects how Git creates archive entries for files:

  • elide_path = false: git archive [options] <commit_id> -- <path> [<exclude>*], <path>/file.ext => <path>/file.ext
  • elide_path = true : git archive [options] <commit_id>:<path> -- [<exclude>*], <path>/file.ext => file.ext

This is necessary for Go support to replace custom archive generation with a call to GetArchive: gitlab#221358 (comment 360527322) and gitlab#223577. Closes #2867 (closed).

Merge request reports

Loading