git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
67196e6317d8f83046c88c897a472333326b00ed blob 1045 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
 
#include "cache.h"
#include "object.h"
#include "argv-array.h"
#include "odb-helper.h"
#include "run-command.h"
#include "sha1-lookup.h"

struct odb_helper *odb_helper_new(const char *name, int namelen)
{
	struct odb_helper *o;

	o = xcalloc(1, sizeof(*o));
	o->name = xmemdupz(name, namelen);

	return o;
}

struct odb_helper_cmd {
	struct argv_array argv;
	struct child_process child;
};

static void odb_helper_load_have(struct odb_helper *o)
{
	if (o->have_valid)
		return;
	o->have_valid = 1;

	/* TODO */
}

static const unsigned char *have_sha1_access(size_t index, void *table)
{
	struct odb_helper_object *have = table;
	return have[index].oid.hash;
}

static struct odb_helper_object *odb_helper_lookup(struct odb_helper *o,
						   const unsigned char *sha1)
{
	int idx;

	odb_helper_load_have(o);
	idx = sha1_pos(sha1, o->have, o->have_nr, have_sha1_access);
	if (idx < 0)
		return NULL;
	return &o->have[idx];
}

int odb_helper_has_object(struct odb_helper *o, const unsigned char *sha1)
{
	return !!odb_helper_lookup(o, sha1);
}

debug log:

solving 67196e6317 ...
found 67196e6317 in https://public-inbox.org/git/20180319133147.15413-2-chriscool@tuxfamily.org/

applying [1/1] https://public-inbox.org/git/20180319133147.15413-2-chriscool@tuxfamily.org/
diff --git a/odb-helper.c b/odb-helper.c
new file mode 100644
index 0000000000..67196e6317

Checking patch odb-helper.c...
1:60: new blank line at EOF.
+
Applied patch odb-helper.c cleanly.
warning: 1 line adds whitespace errors.

index at:
100644 67196e6317d8f83046c88c897a472333326b00ed	odb-helper.c

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).