Пример #1
0
int main(int ac, char **av)
{
	struct split_index *si;
	int i;

	do_read_index(&the_index, av[1], 1);
	printf("own %s\n", sha1_to_hex(the_index.sha1));
	si = the_index.split_index;
	if (!si) {
		printf("not a split index\n");
		return 0;
	}
	printf("base %s\n", sha1_to_hex(si->base_sha1));
	for (i = 0; i < the_index.cache_nr; i++) {
		struct cache_entry *ce = the_index.cache[i];
		printf("%06o %s %d\t%s\n", ce->ce_mode,
		       sha1_to_hex(ce->sha1), ce_stage(ce), ce->name);
	}
	printf("replacements:");
	if (si->replace_bitmap)
		ewah_each_bit(si->replace_bitmap, show_bit, NULL);
	printf("\ndeletions:");
	if (si->delete_bitmap)
		ewah_each_bit(si->delete_bitmap, show_bit, NULL);
	printf("\n");
	return 0;
}
Пример #2
0
static void verify_blowup(struct ewah_bitmap *ewah, struct bitmap *blowup)
{
	struct bitmap *aux = bitmap_new();
	size_t i;
	ewah_each_bit(ewah, &cb__blowup_test, aux);

	for (i = 0; i < aux->word_alloc; ++i) {
		if (aux->words[i] != blowup->words[i]) {
			fprintf(stderr, "[%zu / %zu] %016llx vs %016llx ## FAIL \n",
				i, aux->word_alloc,
				(unsigned long long)aux->words[i],
				(unsigned long long)blowup->words[i]);
				exit(-1);
		}

	}

	bitmap_free(aux);
}
Пример #3
0
void tweak_fsmonitor(struct index_state *istate)
{
	int i;
	int fsmonitor_enabled = git_config_get_fsmonitor();

	if (istate->fsmonitor_dirty) {
		if (fsmonitor_enabled) {
			/* Mark all entries valid */
			for (i = 0; i < istate->cache_nr; i++) {
				istate->cache[i]->ce_flags |= CE_FSMONITOR_VALID;
			}

			/* Mark all previously saved entries as dirty */
			ewah_each_bit(istate->fsmonitor_dirty, fsmonitor_ewah_callback, istate);

			/* Now mark the untracked cache for fsmonitor usage */
			if (istate->untracked)
				istate->untracked->use_fsmonitor = 1;
		}

		ewah_free(istate->fsmonitor_dirty);
		istate->fsmonitor_dirty = NULL;
	}

	switch (fsmonitor_enabled) {
	case -1: /* keep: do nothing */
		break;
	case 0: /* false */
		remove_fsmonitor(istate);
		break;
	case 1: /* true */
		add_fsmonitor(istate);
		break;
	default: /* unknown value: do nothing */
		break;
	}
}
Пример #4
0
static void print_bitmap(const char *name, struct ewah_bitmap *bitmap)
{
	printf("%s = {", name);
	ewah_each_bit(bitmap, &cb__test_print, NULL);
	printf("};\n\n");
}