@@ -1123,12 +1123,12 @@ int git_config_parse_key(const char *key, char **store_key, int *baselen_)
1123
1123
1124
1124
if (last_dot == NULL || last_dot == key ) {
1125
1125
error ("key does not contain a section: %s" , key );
1126
- return -2 ;
1126
+ return - CONFIG_NO_SECTION_OR_NAME ;
1127
1127
}
1128
1128
1129
1129
if (!last_dot [1 ]) {
1130
1130
error ("key does not contain variable name: %s" , key );
1131
- return -2 ;
1131
+ return - CONFIG_NO_SECTION_OR_NAME ;
1132
1132
}
1133
1133
1134
1134
baselen = last_dot - key ;
@@ -1165,7 +1165,7 @@ int git_config_parse_key(const char *key, char **store_key, int *baselen_)
1165
1165
1166
1166
out_free_ret_1 :
1167
1167
free (* store_key );
1168
- return -1 ;
1168
+ return - CONFIG_INVALID_KEY ;
1169
1169
}
1170
1170
1171
1171
/*
@@ -1221,7 +1221,7 @@ int git_config_set_multivar(const char *key, const char *value,
1221
1221
if (fd < 0 ) {
1222
1222
error ("could not lock config file %s: %s" , config_filename , strerror (errno ));
1223
1223
free (store .key );
1224
- ret = -1 ;
1224
+ ret = CONFIG_NO_LOCK ;
1225
1225
goto out_free ;
1226
1226
}
1227
1227
@@ -1235,12 +1235,12 @@ int git_config_set_multivar(const char *key, const char *value,
1235
1235
if ( ENOENT != errno ) {
1236
1236
error ("opening %s: %s" , config_filename ,
1237
1237
strerror (errno ));
1238
- ret = 3 ; /* same as "invalid config file" */
1238
+ ret = CONFIG_INVALID_FILE ; /* same as "invalid config file" */
1239
1239
goto out_free ;
1240
1240
}
1241
1241
/* if nothing to unset, error out */
1242
1242
if (value == NULL ) {
1243
- ret = 5 ;
1243
+ ret = CONFIG_NOTHING_SET ;
1244
1244
goto out_free ;
1245
1245
}
1246
1246
@@ -1268,7 +1268,7 @@ int git_config_set_multivar(const char *key, const char *value,
1268
1268
REG_EXTENDED )) {
1269
1269
error ("invalid pattern: %s" , value_regex );
1270
1270
free (store .value_regex );
1271
- ret = 6 ;
1271
+ ret = CONFIG_INVALID_PATTERN ;
1272
1272
goto out_free ;
1273
1273
}
1274
1274
}
@@ -1290,7 +1290,7 @@ int git_config_set_multivar(const char *key, const char *value,
1290
1290
regfree (store .value_regex );
1291
1291
free (store .value_regex );
1292
1292
}
1293
- ret = 3 ;
1293
+ ret = CONFIG_INVALID_FILE ;
1294
1294
goto out_free ;
1295
1295
}
1296
1296
@@ -1303,7 +1303,7 @@ int git_config_set_multivar(const char *key, const char *value,
1303
1303
/* if nothing to unset, or too many matches, error out */
1304
1304
if ((store .seen == 0 && value == NULL ) ||
1305
1305
(store .seen > 1 && multi_replace == 0 )) {
1306
- ret = 5 ;
1306
+ ret = CONFIG_NOTHING_SET ;
1307
1307
goto out_free ;
1308
1308
}
1309
1309
@@ -1364,7 +1364,7 @@ int git_config_set_multivar(const char *key, const char *value,
1364
1364
1365
1365
if (commit_lock_file (lock ) < 0 ) {
1366
1366
error ("could not commit config file %s" , config_filename );
1367
- ret = 4 ;
1367
+ ret = CONFIG_NO_WRITE ;
1368
1368
goto out_free ;
1369
1369
}
1370
1370
0 commit comments