summaryrefslogtreecommitdiff
path: root/fetch-object-info.h
blob: 2fba96c6f7de52dd7a740a24e935088b75425500 (plain)
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
#ifndef FETCH_OBJECT_INFO_H
#define FETCH_OBJECT_INFO_H

#include "object.h"
#include "pkt-line.h"
#include "protocol.h"

struct fetch_object_info_results {
	size_t *sizes;
	enum object_type *types;
	uint8_t *unrecognized;
	size_t nr;
	unsigned wants_size:1;
	unsigned wants_type:1;
};

#define FETCH_OBJECT_INFO_RESULTS_INIT { 0 }

struct oid_array;
/*
 * Sends git-cat-file object-info command into the request buf and reads the
 * results from packets.
 *
 * The caller sets the wants_* flags in "results" to indicate which attributes
 * it is interested in. On return, "results" holds one array per attribute that
 * the server both advertised and answered with. An array left NULL means the
 * attribute is not available.
 * Release them with free_fetch_object_info_results().
 */
void fetch_object_info(enum protocol_version version,
		       const struct string_list *server_options,
		       const struct oid_array *oids,
		       struct packet_reader *reader,
		       struct fetch_object_info_results *results,
		       int stateless_rpc,
		       int fd_out);

void free_fetch_object_info_results(struct fetch_object_info_results *results);

#endif /* FETCH_OBJECT_INFO_H */