Skip to content

fetch: require a destination for automatic tag following - #7448

Open
akasakariko wants to merge 1 commit into
libgit2:mainfrom
akasakariko:fix/autofollow-tags-require-destination
Open

akasakariko wants to merge 1 commit into
libgit2:mainfrom
akasakariko:fix/autofollow-tags-require-destination

Conversation

@akasakariko

Copy link
Copy Markdown

Fixes #7436

Changes

  • Require a destination-bearing active fetch refspec before AUTO follows tags
  • Ignore passive configured mappings when explicit source-only refspecs are supplied
  • Preserve ALL, explicit tag refspecs, FETCH_HEAD updates and the configured tag policy
  • Clarify AUTO documentation and extend the existing source-only FETCH_HEAD test

Validation

  • Original issue reproducer creates no tags with both Git and libgit2 after the fix
  • Regression fails before the fix with 7 unexpected tags and passes afterward
  • Debug and Release/static builds pass with ENABLE_WERROR=ON, including strict C90 header checks
  • ./libgit2_tests -sfetchhead::nonetwork::create_when_refpecs_given passes
  • ./libgit2_tests -sfetch -sfetchhead -snetwork::fetchlocal -snetwork::remote::local -sremote::fetch passes all 87 cases
  • Related fetch, network, remote and clone suites pass all 230 cases with both files and reftable backends
  • ctest --output-on-failure -R '^(offline|util)$' passes in both builds
  • Manual checks cover configured source-only refs, fallback HEAD, mixed refspecs, ALL and split download/update APIs
  • Smart-transport checks match Git for source-only fetches, explicit tags and a reused remote

Existing Diagnostics

  • Full-file Clang analysis reports the same 10 diagnostics as main, while analysis of the complete changed functions passes
  • Destination-bearing local-transport fetches can still follow off-history tags, unchanged from main and not observed in the smart-transport checks

Match Git by disabling automatic tag following when no active fetch
refspec has a destination, even if passive configured mappings do

Preserve FETCH_HEAD updates, explicit tag refspecs and ALL mode, and
extend the existing source-only fetch test to guard against local tags

Fixes libgit2#7436

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tags are auto-followed when no refspec stores anything (git fetch origin main)

1 participant