Merge branch 'gc/config-partial-submodule-kvi-fix' into next
Partially revert a sanity check that the rest of the config code was not ready, to avoid triggering it in a corner case. * gc/config-partial-submodule-kvi-fix: config: don't BUG when both kvi and source are set
This commit is contained in:
6
config.c
6
config.c
@ -109,8 +109,6 @@ static struct config_reader the_reader;
|
|||||||
static inline void config_reader_push_source(struct config_reader *reader,
|
static inline void config_reader_push_source(struct config_reader *reader,
|
||||||
struct config_source *top)
|
struct config_source *top)
|
||||||
{
|
{
|
||||||
if (reader->config_kvi)
|
|
||||||
BUG("source should not be set while iterating a config set");
|
|
||||||
top->prev = reader->source;
|
top->prev = reader->source;
|
||||||
reader->source = top;
|
reader->source = top;
|
||||||
}
|
}
|
||||||
@ -128,16 +126,12 @@ static inline struct config_source *config_reader_pop_source(struct config_reade
|
|||||||
static inline void config_reader_set_kvi(struct config_reader *reader,
|
static inline void config_reader_set_kvi(struct config_reader *reader,
|
||||||
struct key_value_info *kvi)
|
struct key_value_info *kvi)
|
||||||
{
|
{
|
||||||
if (kvi && (reader->source || reader->parsing_scope))
|
|
||||||
BUG("kvi should not be set while parsing a config source");
|
|
||||||
reader->config_kvi = kvi;
|
reader->config_kvi = kvi;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void config_reader_set_scope(struct config_reader *reader,
|
static inline void config_reader_set_scope(struct config_reader *reader,
|
||||||
enum config_scope scope)
|
enum config_scope scope)
|
||||||
{
|
{
|
||||||
if (scope && reader->config_kvi)
|
|
||||||
BUG("scope should only be set when iterating through a config source");
|
|
||||||
reader->parsing_scope = scope;
|
reader->parsing_scope = scope;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,8 +257,8 @@ test_expect_success 'partial clone with transfer.fsckobjects=1 works with submod
|
|||||||
test_commit -C submodule mycommit &&
|
test_commit -C submodule mycommit &&
|
||||||
|
|
||||||
test_create_repo src_with_sub &&
|
test_create_repo src_with_sub &&
|
||||||
test_config -C src_with_sub uploadpack.allowfilter 1 &&
|
git -C src_with_sub config uploadpack.allowfilter 1 &&
|
||||||
test_config -C src_with_sub uploadpack.allowanysha1inwant 1 &&
|
git -C src_with_sub config uploadpack.allowanysha1inwant 1 &&
|
||||||
|
|
||||||
test_config_global protocol.file.allow always &&
|
test_config_global protocol.file.allow always &&
|
||||||
|
|
||||||
@ -270,6 +270,12 @@ test_expect_success 'partial clone with transfer.fsckobjects=1 works with submod
|
|||||||
test_when_finished rm -rf dst
|
test_when_finished rm -rf dst
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'lazily fetched .gitmodules works' '
|
||||||
|
git clone --filter="blob:none" --no-checkout "file://$(pwd)/src_with_sub" dst &&
|
||||||
|
git -C dst fetch &&
|
||||||
|
test_when_finished rm -rf dst
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'partial clone with transfer.fsckobjects=1 uses index-pack --fsck-objects' '
|
test_expect_success 'partial clone with transfer.fsckobjects=1 uses index-pack --fsck-objects' '
|
||||||
git init src &&
|
git init src &&
|
||||||
test_commit -C src x &&
|
test_commit -C src x &&
|
||||||
|
Reference in New Issue
Block a user