Skip to content

Commit 17126cd

Browse files
stefanbellergitster
authored andcommitted
blob: allow lookup_blob to handle arbitrary repositories
Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 94c09a7 commit 17126cd

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

blob.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
const char *blob_type = "blob";
77

8-
struct blob *lookup_blob_the_repository(const struct object_id *oid)
8+
struct blob *lookup_blob(struct repository *r, const struct object_id *oid)
99
{
10-
struct object *obj = lookup_object(the_repository, oid->hash);
10+
struct object *obj = lookup_object(r, oid->hash);
1111
if (!obj)
12-
return create_object(the_repository, oid->hash,
13-
alloc_blob_node(the_repository));
14-
return object_as_type(the_repository, obj, OBJ_BLOB, 0);
12+
return create_object(r, oid->hash,
13+
alloc_blob_node(r));
14+
return object_as_type(r, obj, OBJ_BLOB, 0);
1515
}
1616

1717
int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size)

blob.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ struct blob {
99
struct object object;
1010
};
1111

12-
#define lookup_blob(r, o) lookup_blob_##r(o)
13-
struct blob *lookup_blob_the_repository(const struct object_id *oid);
12+
struct blob *lookup_blob(struct repository *r, const struct object_id *oid);
1413

1514
int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size);
1615

0 commit comments

Comments
 (0)