Skip to content
Snippets Groups Projects
Commit b2fd6592 authored by Junio C Hamano's avatar Junio C Hamano
Browse files

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

Error codepath fix.

* jk/config-blob-sans-repo:
  config: die when --blob is used outside a repository
parents 0821b730 17b8a2d6
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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;
Loading
Loading
Loading
Loading
@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment