Page MenuHomePhabricator

When fetching Git repositories, pass "--no-tags" to make explicit "Fetch Refs" operate more narrowly
ClosedPublic

Authored by epriestley on Nov 7 2019, 11:51 PM.
Tags
None
Referenced Files
F18624844: D20893.diff
Mon, Sep 15, 9:12 PM
F18615001: D20893.diff
Sun, Sep 14, 1:25 PM
F18567525: D20893.id.diff
Tue, Sep 9, 3:52 PM
F18210431: D20893.id49803.diff
Aug 19 2025, 12:35 AM
F18207789: D20893.id49800.diff
Aug 18 2025, 7:26 PM
F18193025: D20893.id.diff
Aug 17 2025, 4:55 AM
F18179184: D20893.diff
Aug 16 2025, 3:02 AM
F18100789: D20893.diff
Aug 9 2025, 12:05 PM
Subscribers
None

Details

Summary

Ref T13448. The default behavior of "git fetch '+refs/heads/master:refs/heads/master'" is to follow and fetch associated tags.

We don't want this when we pass a narrow refspec because of "Fetch Refs" configuration. Tell Git that we only want the refs we explicitly passed.

Note that this doesn't prevent us from fetching tags (if the refspec specifies them), it just stops us from fetching extra tags that aren't part of the refspec.

Test Plan
  • Ran "bin/repository pull X --trace --verbose" in a repository with a "Fetch Refs" configuration, saw only "master" get fetched (previously: "master" and reachable tags).
  • Ran "git fetch --no-tags '+refs/*:refs/*'", saw tags fetched normally ("--no-tags" does not disable fetching tags).

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable