@@ -646,9 +646,10 @@ static int get_backend_for_use(git_config_backend **out,
646
646
int git_config_delete_entry (git_config * cfg , const char * name )
647
647
{
648
648
git_config_backend * backend ;
649
+ int error = 0 ;
649
650
650
- if (get_backend_for_use (& backend , cfg , name , BACKEND_USE_DELETE ) < 0 )
651
- return GIT_ENOTFOUND ;
651
+ if (( error = get_backend_for_use (& backend , cfg , name , BACKEND_USE_DELETE ) ) < 0 )
652
+ return error ;
652
653
653
654
return backend -> del (backend , name );
654
655
}
@@ -680,8 +681,8 @@ int git_config_set_string(git_config *cfg, const char *name, const char *value)
680
681
return -1 ;
681
682
}
682
683
683
- if (get_backend_for_use (& backend , cfg , name , BACKEND_USE_SET ) < 0 )
684
- return GIT_ENOTFOUND ;
684
+ if (( error = get_backend_for_use (& backend , cfg , name , BACKEND_USE_SET ) ) < 0 )
685
+ return error ;
685
686
686
687
error = backend -> set (backend , name , value );
687
688
@@ -1121,19 +1122,21 @@ int git_config_multivar_iterator_new(git_config_iterator **out, const git_config
1121
1122
int git_config_set_multivar (git_config * cfg , const char * name , const char * regexp , const char * value )
1122
1123
{
1123
1124
git_config_backend * backend ;
1125
+ int error = 0 ;
1124
1126
1125
- if (get_backend_for_use (& backend , cfg , name , BACKEND_USE_DELETE ) < 0 )
1126
- return GIT_ENOTFOUND ;
1127
+ if (( error = get_backend_for_use (& backend , cfg , name , BACKEND_USE_SET ) ) < 0 )
1128
+ return error ;
1127
1129
1128
1130
return backend -> set_multivar (backend , name , regexp , value );
1129
1131
}
1130
1132
1131
1133
int git_config_delete_multivar (git_config * cfg , const char * name , const char * regexp )
1132
1134
{
1133
1135
git_config_backend * backend ;
1136
+ int error = 0 ;
1134
1137
1135
- if (get_backend_for_use (& backend , cfg , name , BACKEND_USE_DELETE ) < 0 )
1136
- return GIT_ENOTFOUND ;
1138
+ if (( error = get_backend_for_use (& backend , cfg , name , BACKEND_USE_DELETE ) ) < 0 )
1139
+ return error ;
1137
1140
1138
1141
return backend -> del_multivar (backend , name , regexp );
1139
1142
}
0 commit comments