1#include "cache.h"
23
static const char *alias_key;
4static char *alias_val;
56
static int alias_lookup_cb(const char *k, const char *v, void *cb)
7{
8if (!prefixcmp(k, "alias.") && !strcmp(k+6, alias_key)) {
9if (!v)
10return config_error_nonbool(k);
11alias_val = xstrdup(v);
12return 0;
13}
14return 0;
15}
1617
char *alias_lookup(const char *alias)
18{
19alias_key = alias;
20alias_val = NULL;
21git_config(alias_lookup_cb, NULL);
22return alias_val;
23}