git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
d26e63d8b1dcba756b374bea0ff58de864215ca9 blob 1449 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
 
#include "cache.h"
#include "external-odb.h"
#include "odb-helper.h"
#include "config.h"

static struct odb_helper *helpers;
static struct odb_helper **helpers_tail = &helpers;

static struct odb_helper *find_or_create_helper(const char *name, int len)
{
	struct odb_helper *o;

	for (o = helpers; o; o = o->next)
		if (!strncmp(o->name, name, len) && !o->name[len])
			return o;

	o = odb_helper_new(name, len);
	*helpers_tail = o;
	helpers_tail = &o->next;

	return o;
}

static int external_odb_config(const char *var, const char *value, void *data)
{
	struct odb_helper *o;
	const char *name;
	int namelen;
	const char *subkey;

	if (parse_config_key(var, "odb", &name, &namelen, &subkey) < 0)
		return 0;

	o = find_or_create_helper(name, namelen);

	if (!strcmp(subkey, "promisorremote"))
		return git_config_string(&o->dealer, var, value);

	return 0;
}

static void external_odb_init(void)
{
	static int initialized;

	if (initialized || !use_external_odb)
		return;
	initialized = 1;

	git_config(external_odb_config, NULL);
}

int has_external_odb(void)
{
	external_odb_init();

	return !!helpers;
}

const char *external_odb_root(void)
{
	static const char *root;
	if (!root)
		root = git_pathdup("objects/external");
	return root;
}

int external_odb_has_object(const unsigned char *sha1)
{
	struct odb_helper *o;

	external_odb_init();

	for (o = helpers; o; o = o->next)
		if (odb_helper_has_object(o, sha1))
			return 1;
	return 0;
}
debug log:

solving d26e63d8b1 ...
found d26e63d8b1 in https://public-inbox.org/git/20180319133147.15413-5-chriscool@tuxfamily.org/ ||
	https://public-inbox.org/git/20180103163403.11303-4-chriscool@tuxfamily.org/
found 390958dbfe in https://public-inbox.org/git/20180319133147.15413-4-chriscool@tuxfamily.org/ ||
	https://public-inbox.org/git/20180103163403.11303-3-chriscool@tuxfamily.org/
found f3ea491333 in https://public-inbox.org/git/20180319133147.15413-2-chriscool@tuxfamily.org/ ||
	https://public-inbox.org/git/20180103163403.11303-2-chriscool@tuxfamily.org/

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

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

skipping https://public-inbox.org/git/20180103163403.11303-2-chriscool@tuxfamily.org/ for f3ea491333
index at:
100644 f3ea4913339d88091227fb073a5603625d93848e	external-odb.c

applying [2/6] https://public-inbox.org/git/20180319133147.15413-4-chriscool@tuxfamily.org/
diff --git a/external-odb.c b/external-odb.c
index f3ea491333..390958dbfe 100644

Checking patch external-odb.c...
Applied patch external-odb.c cleanly.

skipping https://public-inbox.org/git/20180103163403.11303-3-chriscool@tuxfamily.org/ for 390958dbfe
index at:
100644 390958dbfec20409e7b9aade6993ace6ff688605	external-odb.c

applying [3/6] https://public-inbox.org/git/20180319133147.15413-5-chriscool@tuxfamily.org/
diff --git a/external-odb.c b/external-odb.c
index 390958dbfe..d26e63d8b1 100644

Checking patch external-odb.c...
Applied patch external-odb.c cleanly.

skipping https://public-inbox.org/git/20180103163403.11303-4-chriscool@tuxfamily.org/ for d26e63d8b1
index at:
100644 d26e63d8b1dcba756b374bea0ff58de864215ca9	external-odb.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).