Skip to content

gitserver: Pass pathspecs to git archive

Administrator requested to merge git-archive-literal-paths into main

Created by: chrismwendt

Keegan discovered that the "paths" passed to git archive are actually "pathspecs" with glob-like syntax. Git docs:

https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec

This PR:

  • Renames Paths to Pathspecs to more accurately reflect that reality
  • Adds a nominal type type Pathspec string to help avoid footgunning ourselves
  • Prefixes pathspecs with :(literal) where appropriate to prevent * and ? from being interpreted as special characters

CC

  • @keegancsmith who discovered it
  • @tsenart who worked on lockfile detection
  • @mollylogue who has been working on sub-repo perms and git archive recently

Test plan

Ran locally, did search-based code intel on a couple commits to exercise the git archive calls in the symbols service.

Merge request reports

Loading