Revision f74bbc8dd2637498bc07132ae6bfa6d1b88dafb0 authored by Jeff King on 21 February 2018, 23:27:24 UTC, committed by Junio C Hamano on 22 February 2018, 20:15:25 UTC
This was an undocumented debugging aid that does not seem to
have come in handy in the past decade, judging from its lack
of mentions on the mailing list.

Let's drop it in the name of simplicity. This is morally a
revert of 3131b71301 (Add "--show-all" revision walker flag
for debugging, 2008-02-09), but note that I did leave in the
mapping of UNINTERESTING to "^" in get_revision_mark(). I
don't think this would be possible to trigger with the
current code, but it's the only sensible marker.

We'll skip the usual deprecation period because this was
explicitly a debugging aid that was never documented.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 7fa31b6
Raw File
oidset.c
#include "cache.h"
#include "oidset.h"

int oidset_contains(const struct oidset *set, const struct object_id *oid)
{
	if (!set->map.map.tablesize)
		return 0;
	return !!oidmap_get(&set->map, oid);
}

int oidset_insert(struct oidset *set, const struct object_id *oid)
{
	struct oidmap_entry *entry;

	if (!set->map.map.tablesize)
		oidmap_init(&set->map, 0);
	else if (oidset_contains(set, oid))
		return 1;

	entry = xmalloc(sizeof(*entry));
	oidcpy(&entry->oid, oid);

	oidmap_put(&set->map, entry);
	return 0;
}

int oidset_remove(struct oidset *set, const struct object_id *oid)
{
	struct oidmap_entry *entry;

	entry = oidmap_remove(&set->map, oid);
	free(entry);

	return (entry != NULL);
}

void oidset_clear(struct oidset *set)
{
	oidmap_free(&set->map, 1);
}
back to top