Re: [PATCH v4 6/6] config: add '--show-scope' to print the scope of a config value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Matthew Rogers via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:

> +const char *scope_to_string(enum config_scope scope)
> +{
> +	switch (scope) {
> +	case CONFIG_SCOPE_SYSTEM:
> +		return "system";
> +	case CONFIG_SCOPE_GLOBAL:
> +		return "global";
> +	case CONFIG_SCOPE_LOCAL:
> +		return "local";

Despite the screw-up at an earlier step, this one is correct ;-)

> +	case CONFIG_SCOPE_WORKTREE:
> +		return "worktree";
> +	case CONFIG_SCOPE_COMMAND:
> +		return "command";
> +	case CONFIG_SCOPE_SUBMODULE:
> +		return "submodule";
> +	default:
> +		return "unknown";
> +	}
> +}
> +

> diff --git a/t/t1300-config.sh b/t/t1300-config.sh
> index e5fb9114f6..79dbea9bd1 100755
> --- a/t/t1300-config.sh
> +++ b/t/t1300-config.sh
> @@ -1771,6 +1771,65 @@ test_expect_success '--show-origin blob ref' '
>  	test_cmp expect output
>  '
>  
> +test_expect_success '--show-scope with --list' '
> +	cat >expect <<-EOF &&
> +		global	user.global=true
> +		global	user.override=global
> +		global	include.path=$INCLUDE_DIR/absolute.include
> +		global	user.absolute=include
> +		local	user.local=true
> +		local	user.override=local
> +		local	include.path=../include/relative.include
> +		local	user.relative=include
> +		command	user.cmdline=true
> +	EOF

We cleaned up the existing ones that are overly indented from this
script in an earlier step.  Let's not re-introduce them.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux