From: Junio C Hamano Date: Fri, 22 Aug 2025 20:13:21 +0000 (-0700) Subject: Merge branch 'ac/deglobal-fmt-merge-log-config' X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9d6e319ec5190a0f5e19d8c7b7a73a4439042df6;p=thirdparty%2Fgit.git Merge branch 'ac/deglobal-fmt-merge-log-config' Code clean-up. * ac/deglobal-fmt-merge-log-config: builtin/fmt-merge-msg: stop depending on 'the_repository' environment: remove the global variable 'merge_log_config' --- 9d6e319ec5190a0f5e19d8c7b7a73a4439042df6 diff --cc builtin/merge.c index c3810c9cb2,1c921b12f5..783ca66377 --- a/builtin/merge.c +++ b/builtin/merge.c @@@ -1392,7 -1335,7 +1393,7 @@@ int cmd_merge(int argc skip_prefix(branch, "refs/heads/", &branch); init_diff_ui_defaults(); - repo_config(the_repository, git_merge_config, NULL); - git_config(git_merge_config, &merge_log_config); ++ repo_config(the_repository, git_merge_config, &merge_log_config); if (!branch || is_null_oid(&head_oid)) head_commit = NULL; diff --cc t/t1517-outside-repo.sh index 3dc602872a,f6d3206cfe..5ce0ceb176 --- a/t/t1517-outside-repo.sh +++ b/t/t1517-outside-repo.sh @@@ -107,32 -107,18 +107,39 @@@ test_expect_success LIBCURL 'remote-htt test_grep "^error: remote-curl" actual ' -test_expect_success 'update-server-info does not crash with -h' ' - test_expect_code 129 git update-server-info -h >usage && - test_grep "[Uu]sage: git update-server-info " usage && - test_expect_code 129 nongit git update-server-info -h >usage && - test_grep "[Uu]sage: git update-server-info " usage -' +for cmd in $(git --list-cmds=main) +do + cmd=${cmd%.*} # strip .sh, .perl, etc. + case "$cmd" in + archimport | cvsexportcommit | cvsimport | cvsserver | daemon | \ + difftool--helper | filter-branch | fsck-objects | get-tar-commit-id | \ + http-backend | http-fetch | http-push | init-db | \ + merge-octopus | merge-one-file | merge-resolve | mergetool | \ + mktag | p4 | p4.py | pickaxe | remote-ftp | remote-ftps | \ + remote-http | remote-https | replay | send-email | \ + sh-i18n--envsubst | shell | show | stage | submodule | svn | \ + upload-archive--writer | upload-pack | web--browse | whatchanged) + expect_outcome=expect_failure ;; + *) + expect_outcome=expect_success ;; + esac + case "$cmd" in + instaweb) + prereq=PERL ;; + *) + prereq= ;; + esac + test_$expect_outcome $prereq "'git $cmd -h' outside a repository" ' + test_expect_code 129 nongit git $cmd -h >usage && + test_grep "[Uu]sage: git $cmd " usage + ' +done + test_expect_success 'fmt-merge-msg does not crash with -h' ' + test_expect_code 129 git fmt-merge-msg -h >usage && + test_grep "[Uu]sage: git fmt-merge-msg " usage && + test_expect_code 129 nongit git fmt-merge-msg -h >usage && + test_grep "[Uu]sage: git fmt-merge-msg " usage + ' + test_done