@ -312,7 +312,7 @@ func CheckGitVersionAtLeast(atLeast string) error {
}
func configSet ( key , value string ) error {
stdout , _ , err := NewCommand ( DefaultContext , "config" , "--g et") . AddDynamicArguments ( key ) . RunStdString ( nil )
stdout , _ , err := NewCommand ( DefaultContext , "config" , "--g lobal", "--g et") . AddDynamicArguments ( key ) . RunStdString ( nil )
if err != nil && ! err . IsExitCode ( 1 ) {
return fmt . Errorf ( "failed to get git config %s, err: %w" , key , err )
}
@ -331,7 +331,7 @@ func configSet(key, value string) error {
}
func configSetNonExist ( key , value string ) error {
_ , _ , err := NewCommand ( DefaultContext , "config" , "--g et") . AddDynamicArguments ( key ) . RunStdString ( nil )
_ , _ , err := NewCommand ( DefaultContext , "config" , "--g lobal", "--g et") . AddDynamicArguments ( key ) . RunStdString ( nil )
if err == nil {
// already exist
return nil
@ -349,7 +349,7 @@ func configSetNonExist(key, value string) error {
}
func configAddNonExist ( key , value string ) error {
_ , _ , err := NewCommand ( DefaultContext , "config" , "--g et") . AddDynamicArguments ( key , regexp . QuoteMeta ( value ) ) . RunStdString ( nil )
_ , _ , err := NewCommand ( DefaultContext , "config" , "--g lobal", "--g et") . AddDynamicArguments ( key , regexp . QuoteMeta ( value ) ) . RunStdString ( nil )
if err == nil {
// already exist
return nil
@ -366,7 +366,7 @@ func configAddNonExist(key, value string) error {
}
func configUnsetAll ( key , value string ) error {
_ , _ , err := NewCommand ( DefaultContext , "config" , "--g et") . AddDynamicArguments ( key ) . RunStdString ( nil )
_ , _ , err := NewCommand ( DefaultContext , "config" , "--g lobal", "--g et") . AddDynamicArguments ( key ) . RunStdString ( nil )
if err == nil {
// exist, need to remove
_ , _ , err = NewCommand ( DefaultContext , "config" , "--global" , "--unset-all" ) . AddDynamicArguments ( key , regexp . QuoteMeta ( value ) ) . RunStdString ( nil )