Merge branch 'jk/repo-init-cleanup'
Further clean-up of the initialization code. * jk/repo-init-cleanup: config: stop checking whether the_repository is NULL common-main: delay trace2 initialization t1309: use short branch name in includeIf.onbranch test
This commit is contained in:
@ -39,16 +39,16 @@ int main(int argc, const char **argv)
|
|||||||
|
|
||||||
git_resolve_executable_dir(argv[0]);
|
git_resolve_executable_dir(argv[0]);
|
||||||
|
|
||||||
trace2_initialize();
|
|
||||||
trace2_cmd_start(argv);
|
|
||||||
trace2_collect_process_info(TRACE2_PROCESS_INFO_STARTUP);
|
|
||||||
|
|
||||||
git_setup_gettext();
|
git_setup_gettext();
|
||||||
|
|
||||||
initialize_the_repository();
|
initialize_the_repository();
|
||||||
|
|
||||||
attr_start();
|
attr_start();
|
||||||
|
|
||||||
|
trace2_initialize();
|
||||||
|
trace2_cmd_start(argv);
|
||||||
|
trace2_collect_process_info(TRACE2_PROCESS_INFO_STARTUP);
|
||||||
|
|
||||||
result = cmd_main(argc, argv);
|
result = cmd_main(argc, argv);
|
||||||
|
|
||||||
trace2_cmd_exit(result);
|
trace2_cmd_exit(result);
|
||||||
|
2
config.c
2
config.c
@ -275,7 +275,7 @@ static int include_by_branch(const char *cond, size_t cond_len)
|
|||||||
int flags;
|
int flags;
|
||||||
int ret;
|
int ret;
|
||||||
struct strbuf pattern = STRBUF_INIT;
|
struct strbuf pattern = STRBUF_INIT;
|
||||||
const char *refname = !the_repository || !the_repository->gitdir ?
|
const char *refname = !the_repository->gitdir ?
|
||||||
NULL : resolve_ref_unsafe("HEAD", 0, NULL, &flags);
|
NULL : resolve_ref_unsafe("HEAD", 0, NULL, &flags);
|
||||||
const char *shortname;
|
const char *shortname;
|
||||||
|
|
||||||
|
@ -91,7 +91,12 @@ test_expect_failure 'ignore .git/ with invalid config' '
|
|||||||
|
|
||||||
test_expect_success 'early config and onbranch' '
|
test_expect_success 'early config and onbranch' '
|
||||||
echo "[broken" >broken &&
|
echo "[broken" >broken &&
|
||||||
test_with_config "[includeif \"onbranch:refs/heads/master\"]path=../broken"
|
test_with_config "[includeif \"onbranch:master\"]path=../broken"
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success 'onbranch config outside of git repo' '
|
||||||
|
test_config_global includeIf.onbranch:master.path non-existent &&
|
||||||
|
nongit git help
|
||||||
'
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
Reference in New Issue
Block a user