object-info: support for retrieving object info

Sometimes it is useful to get information of an object without having to
download it completely.

Add the "object-info" capability that lets the client ask for
object-related information with their full hexadecimal object names.

Only sizes are returned for now.

Signed-off-by: Bruno Albuquerque <bga@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Bruno Albuquerque
2021-04-20 16:38:31 -07:00
committed by Junio C Hamano
parent d1b10fc6d8
commit a2ba162cda
6 changed files with 183 additions and 0 deletions

10
protocol-caps.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef PROTOCOL_CAPS_H
#define PROTOCOL_CAPS_H
struct repository;
struct strvec;
struct packet_reader;
int cap_object_info(struct repository *r, struct strvec *keys,
struct packet_reader *request);
#endif /* PROTOCOL_CAPS_H */