diff options
Diffstat (limited to 'builtin/unpack-file.c')
-rw-r--r-- | builtin/unpack-file.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/builtin/unpack-file.c b/builtin/unpack-file.c index 88de32b7d7..b35a4b9dfe 100644 --- a/builtin/unpack-file.c +++ b/builtin/unpack-file.c @@ -1,6 +1,9 @@ #include "builtin.h" #include "config.h" +#include "hex.h" +#include "object-name.h" #include "object-store.h" +#include "wrapper.h" static char *create_temp_file(struct object_id *oid) { @@ -10,7 +13,7 @@ static char *create_temp_file(struct object_id *oid) unsigned long size; int fd; - buf = read_object_file(oid, &type, &size); + buf = repo_read_object_file(the_repository, oid, &type, &size); if (!buf || type != OBJ_BLOB) die("unable to read blob object %s", oid_to_hex(oid)); @@ -23,13 +26,13 @@ static char *create_temp_file(struct object_id *oid) return path; } -int cmd_unpack_file(int argc, const char **argv, const char *prefix) +int cmd_unpack_file(int argc, const char **argv, const char *prefix UNUSED) { struct object_id oid; if (argc != 2 || !strcmp(argv[1], "-h")) usage("git unpack-file <blob>"); - if (get_oid(argv[1], &oid)) + if (repo_get_oid(the_repository, argv[1], &oid)) die("Not a valid object name %s", argv[1]); git_config(git_default_config, NULL); |