@@ -2737,12 +2737,17 @@ __git_compute_config_vars_all ()
2737
2737
__git_config_vars_all=" $( git --no-pager help --config) "
2738
2738
}
2739
2739
2740
+ __git_indirect ()
2741
+ {
2742
+ eval printf ' %s' " \"\$ $1 \" "
2743
+ }
2744
+
2740
2745
__git_compute_first_level_config_vars_for_section ()
2741
2746
{
2742
2747
local section=" $1 "
2743
2748
__git_compute_config_vars
2744
2749
local this_section=" __git_first_level_config_vars_for_section_${section} "
2745
- test -n " ${ ! this_section} " ||
2750
+ test -n " $( __git_indirect " ${ this_section}" ) " ||
2746
2751
printf -v " __git_first_level_config_vars_for_section_${section} " %s \
2747
2752
" $( echo " $__git_config_vars " | awk -F. " /^${section} \.[a-z]/ { print \$ 2 }" ) "
2748
2753
}
@@ -2752,7 +2757,7 @@ __git_compute_second_level_config_vars_for_section ()
2752
2757
local section=" $1 "
2753
2758
__git_compute_config_vars_all
2754
2759
local this_section=" __git_second_level_config_vars_for_section_${section} "
2755
- test -n " ${ ! this_section} " ||
2760
+ test -n " $( __git_indirect " ${ this_section}" ) " ||
2756
2761
printf -v " __git_second_level_config_vars_for_section_${section} " %s \
2757
2762
" $( echo " $__git_config_vars_all " | awk -F. " /^${section} \.</ { print \$ 3 }" ) "
2758
2763
}
@@ -2907,7 +2912,7 @@ __git_complete_config_variable_name ()
2907
2912
local section=" ${pfx% .* .} "
2908
2913
__git_compute_second_level_config_vars_for_section " ${section} "
2909
2914
local this_section=" __git_second_level_config_vars_for_section_${section} "
2910
- __gitcomp " ${ ! this_section} " " $pfx " " $cur_ " " $sfx "
2915
+ __gitcomp " $( __git_indirect " ${ this_section}" ) " " $pfx " " $cur_ " " $sfx "
2911
2916
return
2912
2917
;;
2913
2918
branch.* )
@@ -2917,7 +2922,7 @@ __git_complete_config_variable_name ()
2917
2922
__gitcomp_direct " $( __git_heads " $pfx " " $cur_ " " ." ) "
2918
2923
__git_compute_first_level_config_vars_for_section " ${section} "
2919
2924
local this_section=" __git_first_level_config_vars_for_section_${section} "
2920
- __gitcomp_nl_append " ${ ! this_section} " " $pfx " " $cur_ " " ${sfx:- } "
2925
+ __gitcomp_nl_append " $( __git_indirect " ${ this_section}" ) " " $pfx " " $cur_ " " ${sfx:- } "
2921
2926
return
2922
2927
;;
2923
2928
pager.* )
@@ -2934,7 +2939,7 @@ __git_complete_config_variable_name ()
2934
2939
__gitcomp_nl " $( __git_remotes) " " $pfx " " $cur_ " " ."
2935
2940
__git_compute_first_level_config_vars_for_section " ${section} "
2936
2941
local this_section=" __git_first_level_config_vars_for_section_${section} "
2937
- __gitcomp_nl_append " ${ ! this_section} " " $pfx " " $cur_ " " ${sfx:- } "
2942
+ __gitcomp_nl_append " $( __git_indirect " ${ this_section}" ) " " $pfx " " $cur_ " " ${sfx:- } "
2938
2943
return
2939
2944
;;
2940
2945
submodule.* )
@@ -2944,7 +2949,7 @@ __git_complete_config_variable_name ()
2944
2949
__gitcomp_nl " $( __git config -f " $( __git rev-parse --show-toplevel) /.gitmodules" --get-regexp ' submodule.*.path' | awk -F. ' {print $2}' ) " " $pfx " " $cur_ " " ."
2945
2950
__git_compute_first_level_config_vars_for_section " ${section} "
2946
2951
local this_section=" __git_first_level_config_vars_for_section_${section} "
2947
- __gitcomp_nl_append " ${ ! this_section} " " $pfx " " $cur_ " " ${sfx:- } "
2952
+ __gitcomp_nl_append " $( __git_indirect " ${ this_section}" ) " " $pfx " " $cur_ " " ${sfx:- } "
2948
2953
return
2949
2954
;;
2950
2955
* .* )
0 commit comments