Skip to content

Commit f5c39c3

Browse files
avargitster
authored andcommitted
config API: use get_error_routine(), not vreportf()
Change the git_die_config() function added in 5a80e97 (config: add `git_die_config()` to the config-set API, 2014-08-07) to use the public callbacks in the usage.[ch] API instead of the the underlying vreportf() function. In preceding commits the rest of the vreportf() users outside of usage.c was migrated to die_message(), so we can now make it "static". Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 24f6e6d commit f5c39c3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

config.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2555,11 +2555,12 @@ void git_die_config(const char *key, const char *err, ...)
25552555
{
25562556
const struct string_list *values;
25572557
struct key_value_info *kv_info;
2558+
report_fn error_fn = get_error_routine();
25582559

25592560
if (err) {
25602561
va_list params;
25612562
va_start(params, err);
2562-
vreportf("error: ", err, params);
2563+
error_fn(err, params);
25632564
va_end(params);
25642565
}
25652566
values = git_config_get_value_multi(key);

git-compat-util.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,6 @@ static inline int git_has_dir_sep(const char *path)
474474
struct strbuf;
475475

476476
/* General helper functions */
477-
void vreportf(const char *prefix, const char *err, va_list params);
478477
NORETURN void usage(const char *err);
479478
NORETURN void usagef(const char *err, ...) __attribute__((format (printf, 1, 2)));
480479
NORETURN void die(const char *err, ...) __attribute__((format (printf, 1, 2)));

usage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "git-compat-util.h"
77
#include "cache.h"
88

9-
void vreportf(const char *prefix, const char *err, va_list params)
9+
static void vreportf(const char *prefix, const char *err, va_list params)
1010
{
1111
char msg[4096];
1212
char *p, *pend = msg + sizeof(msg);

0 commit comments

Comments
 (0)