예제 #1
0
파일: unpack-trees.c 프로젝트: 2quala/git
static int compare_entry(const struct cache_entry *ce, const struct traverse_info *info, const struct name_entry *n)
{
	int cmp = do_compare_entry(ce, info, n);
	if (cmp)
		return cmp;

	/*
	 * Even if the beginning compared identically, the ce should
	 * compare as bigger than a directory leading up to it!
	 */
	return ce_namelen(ce) > traverse_path_len(info, n);
}
예제 #2
0
파일: unpack-trees.c 프로젝트: 2quala/git
static struct cache_entry *create_ce_entry(const struct traverse_info *info, const struct name_entry *n, int stage)
{
	int len = traverse_path_len(info, n);
	struct cache_entry *ce = xcalloc(1, cache_entry_size(len));

	ce->ce_mode = create_ce_mode(n->mode);
	ce->ce_flags = create_ce_flags(stage);
	ce->ce_namelen = len;
	hashcpy(ce->sha1, n->sha1);
	make_traverse_path(ce->name, info, n);

	return ce;
}
예제 #3
0
static char *traverse_path(const struct traverse_info *info, const struct name_entry *n)
{
	char *path = xmalloc(traverse_path_len(info, n) + 1);
	return make_traverse_path(path, info, n);
}
예제 #4
0
파일: merge-tree.c 프로젝트: koraktor/git
static char *traverse_path(const struct traverse_info *info, const struct name_entry *n)
{
	char *path = xmallocz(traverse_path_len(info, n) + the_hash_algo->rawsz);
	return make_traverse_path(path, info, n);
}