summaryrefslogtreecommitdiff
path: root/builtin/hash-object.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/hash-object.c')
-rw-r--r--builtin/hash-object.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/hash-object.c b/builtin/hash-object.c
index 9ada4f4dfd..640ef4ded5 100644
--- a/builtin/hash-object.c
+++ b/builtin/hash-object.c
@@ -40,7 +40,8 @@ static void hash_fd(int fd, const char *type, const char *path, unsigned flags,
if (fstat(fd, &st) < 0 ||
(literally
? hash_literally(&oid, fd, type, flags)
- : index_fd(&oid, fd, &st, type_from_string(type), path, flags)))
+ : index_fd(the_repository->index, &oid, fd, &st,
+ type_from_string(type), path, flags)))
die((flags & HASH_WRITE_OBJECT)
? "Unable to add %s to database"
: "Unable to hash %s", path);
@@ -107,7 +108,7 @@ int cmd_hash_object(int argc, const char **argv, const char *prefix)
int i;
const char *errstr = NULL;
- argc = parse_options(argc, argv, NULL, hash_object_options,
+ argc = parse_options(argc, argv, prefix, hash_object_options,
hash_object_usage, 0);
if (flags & HASH_WRITE_OBJECT)