git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
ccc4ea7f1a26f6aa68541cff6280da2d3241121a blob 1261 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
 
#include "cache.h"
#include "packfile.h"
#include "pkt-line.h"
#include "strbuf.h"
#include "transport.h"
#include "fetch-object.h"

static int fetch_refs(const char *remote_name, struct ref *ref)
{
	struct remote *remote;
	struct transport *transport;
	int original_fetch_if_missing = fetch_if_missing;
	int res;

	fetch_if_missing = 0;
	remote = remote_get(remote_name);
	if (!remote->url[0])
		die(_("Remote with no URL"));
	transport = transport_get(remote, remote->url[0]);

	transport_set_option(transport, TRANS_OPT_FROM_PROMISOR, "1");
	transport_set_option(transport, TRANS_OPT_NO_DEPENDENTS, "1");
	res = transport_fetch_refs(transport, ref);
	fetch_if_missing = original_fetch_if_missing;

	return res;
}

int fetch_object(const char *remote_name, const unsigned char *sha1)
{
	struct ref *ref = alloc_ref(sha1_to_hex(sha1));
	hashcpy(ref->old_oid.hash, sha1);
	return fetch_refs(remote_name, ref);
}

int fetch_objects(const char *remote_name, const struct oid_array *to_fetch)
{
	struct ref *ref = NULL;
	int i;

	for (i = 0; i < to_fetch->nr; i++) {
		struct ref *new_ref = alloc_ref(oid_to_hex(&to_fetch->oid[i]));
		oidcpy(&new_ref->old_oid, &to_fetch->oid[i]);
		new_ref->next = ref;
		ref = new_ref;
	}
	return fetch_refs(remote_name, ref);
}
debug log:

solving ccc4ea7f1a ...
found ccc4ea7f1a in https://public-inbox.org/git/20180513103232.17514-2-chriscool@tuxfamily.org/ ||
	https://public-inbox.org/git/20180623121846.19750-2-chriscool@tuxfamily.org/ ||
	https://public-inbox.org/git/20180630083542.20347-2-chriscool@tuxfamily.org/ ||
	https://public-inbox.org/git/20180713174959.16748-2-chriscool@tuxfamily.org/
found 853624f811 in https://80x24.org/mirrors/git.git
preparing index
index prepared:
100644 853624f811c59c17af88814ebeecf4154095a19c	fetch-object.c

applying [1/4] https://public-inbox.org/git/20180513103232.17514-2-chriscool@tuxfamily.org/
diff --git a/fetch-object.c b/fetch-object.c
index 853624f811..ccc4ea7f1a 100644

Checking patch fetch-object.c...
Applied patch fetch-object.c cleanly.

skipping https://public-inbox.org/git/20180623121846.19750-2-chriscool@tuxfamily.org/ for ccc4ea7f1a
skipping https://public-inbox.org/git/20180630083542.20347-2-chriscool@tuxfamily.org/ for ccc4ea7f1a
skipping https://public-inbox.org/git/20180713174959.16748-2-chriscool@tuxfamily.org/ for ccc4ea7f1a
index at:
100644 ccc4ea7f1a26f6aa68541cff6280da2d3241121a	fetch-object.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).