Re: [PATCH v1] repository: move fetch_if_missing into struct repository
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 16, 2026, 15:28 UTC
- Message-ID
- <xmqqh5lzhs22.fsf@gitster.g>
- In-Reply-To
- <alcqQp0lkwRIIE1t@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 19 quoted lines
>> /* >> * index-pack never needs to fetch missing objects except when >> * REF_DELTA bases are missing (which are explicitly handled). It only >> * accesses the repo to do hash collision checks and to check which >> * REF_DELTA bases need to be fetched. >> */ >> - fetch_if_missing = 0; >> - >> - show_usage_if_asked(argc, argv, index_pack_usage); >> + if (repo) >> + repo->fetch_if_missing = 0; >> >> disable_replace_refs(); >> > > Okay. This command can run without a repository, in which case we'll end > up just indexing the pack. My assumption is that we'll probably end up > using `the_repository` if so, as we still use `the_repository` in this > file. So could this here cause a change in behaviour?
Meaning that even outside a repository, we could have read the setting from ~/.gitconfig or some other places other than the per-repository .git/config file?