vendir icon indicating copy to clipboard operation
vendir copied to clipboard

fix(git): optimize fetch to selectively include tags and checkout exa…

Open fpytloun opened this issue 3 months ago • 1 comments

  • Disabled unconditional addition of "remote.origin.tagOpt" config; only add if not fetching exact ref
  • Introduced exactRef flag to detect when fetching a specific origin ref
  • When fetching exact ref, checkout uses "FETCH_HEAD" instead of the ref name to avoid detached head advice
  • Cleaned up commented-out code and improved fetch argument logic accordingly

Fixes: https://github.com/carvel-dev/vendir/issues/102

fpytloun avatar Oct 13 '25 14:10 fpytloun

I am a little bit concerned with this change since we tried removing that same line before and failed for some cases like: #263 Can you please confirm that a we will not have a regression here?

I read that issue and assuming failure was this: https://github.com/carvel-dev/vendir/issues/263#issuecomment-1583253263

The trick is to simply checkout FETCH_HEAD instead of unresolved tag 🙂

fpytloun avatar Oct 13 '25 21:10 fpytloun