diff options
author | Jeff King <peff@peff.net> | 2014-11-04 08:11:19 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-11-04 12:13:46 -0800 |
commit | 72549dfd5d33424fbf557b0078503687780a3a53 (patch) | |
tree | c09c33551f6107a25bee4b512f87a51081952980 /t/t4100 | |
parent | Merge branch 'maint-1.9' into maint-2.0 (diff) | |
download | tgif-72549dfd5d33424fbf557b0078503687780a3a53.tar.xz |
fetch: load all default config at startup
When we start the git-fetch program, we call git_config to
load all config, but our callback only processes the
fetch.prune option; we do not chain to git_default_config at
all.
This means that we may not load some core configuration
which will have an effect. For instance, we do not load
core.logAllRefUpdates, which impacts whether or not we
create reflogs in a bare repository.
Note that I said "may" above. It gets even more exciting. If
we have to transfer actual objects as part of the fetch,
then we call fetch_pack as part of the same process. That
function loads its own config, which does chain to
git_default_config, impacting global variables which are
used by the rest of fetch. But if the fetch is a pure ref
update (e.g., a new ref which is a copy of an old one), we
skip fetch_pack entirely. So we get inconsistent results
depending on whether or not we have actual objects to
transfer or not!
Let's just load the core config at the start of fetch, so we
know we have it (we may also load it again as part of
fetch_pack, but that's OK; it's designed to be idempotent).
Our tests check both cases (with and without a pack). We
also check similar behavior for push for good measure, but
it already works as expected.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4100')
0 files changed, 0 insertions, 0 deletions