提交 b2fd6592 编写于 作者: J Junio C Hamano

Merge branch 'jk/config-blob-sans-repo'

Error codepath fix.

* jk/config-blob-sans-repo:
  config: die when --blob is used outside a repository
......@@ -602,6 +602,9 @@ int cmd_config(int argc, const char **argv, const char *prefix)
if (use_local_config && nongit)
die(_("--local can only be used inside a git repository"));
if (given_config_source.blob && nongit)
die(_("--blob can only be used inside a git repository"));
if (given_config_source.file &&
!strcmp(given_config_source.file, "-")) {
given_config_source.file = NULL;
......
......@@ -73,4 +73,8 @@ test_expect_success 'can parse blob ending with CR' '
test_cmp expect actual
'
test_expect_success 'config --blob outside of a repository is an error' '
test_must_fail nongit git config --blob=foo --list
'
test_done
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册