Staging
v0.5.1
https://github.com/git/git
Revision 9bd81e4249a419f9cde8fd68e033e263533f4914 authored by Junio C Hamano on 25 May 2008, 21:25:02 UTC, committed by Junio C Hamano on 25 May 2008, 21:25:02 UTC
* js/config-cb:
  Provide git_config with a callback-data parameter

Conflicts:

	builtin-add.c
	builtin-cat-file.c
2 parent s 450c5ae + ef90d6d
Raw File
Tip revision: 9bd81e4249a419f9cde8fd68e033e263533f4914 authored by Junio C Hamano on 25 May 2008, 21:25:02 UTC
Merge branch 'js/config-cb'
Tip revision: 9bd81e4
alias.c
#include "cache.h"

static const char *alias_key;
static char *alias_val;

static int alias_lookup_cb(const char *k, const char *v, void *cb)
{
	if (!prefixcmp(k, "alias.") && !strcmp(k+6, alias_key)) {
		if (!v)
			return config_error_nonbool(k);
		alias_val = xstrdup(v);
		return 0;
	}
	return 0;
}

char *alias_lookup(const char *alias)
{
	alias_key = alias;
	alias_val = NULL;
	git_config(alias_lookup_cb, NULL);
	return alias_val;
}
back to top