diff options
author | Patryk Obara <patryk.obara@gmail.com> | 2017-08-20 23:09:28 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-21 07:51:38 +0300 |
commit | 98e019b067ac8a34e06f9c412f14a080c7c4dc0d (patch) | |
tree | 993e29b9bcffe7603f5b7d377af86aefbb7f1785 /sha1_file.c | |
parent | bebfecb94c5c71091a07ebbd300740990d3266c7 (diff) |
sha1_file: convert index_path to struct object_id
Convert all remaining callers as well.
Signed-off-by: Patryk Obara <patryk.obara@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_file.c')
-rw-r--r-- | sha1_file.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sha1_file.c b/sha1_file.c index b60ae15f706..6a2a48ba206 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -3686,7 +3686,7 @@ int index_fd(unsigned char *sha1, int fd, struct stat *st, return ret; } -int index_path(unsigned char *sha1, const char *path, struct stat *st, unsigned flags) +int index_path(struct object_id *oid, const char *path, struct stat *st, unsigned flags) { int fd; struct strbuf sb = STRBUF_INIT; @@ -3696,7 +3696,7 @@ int index_path(unsigned char *sha1, const char *path, struct stat *st, unsigned fd = open(path, O_RDONLY); if (fd < 0) return error_errno("open(\"%s\")", path); - if (index_fd(sha1, fd, st, OBJ_BLOB, path, flags) < 0) + if (index_fd(oid->hash, fd, st, OBJ_BLOB, path, flags) < 0) return error("%s: failed to insert into database", path); break; @@ -3704,14 +3704,14 @@ int index_path(unsigned char *sha1, const char *path, struct stat *st, unsigned if (strbuf_readlink(&sb, path, st->st_size)) return error_errno("readlink(\"%s\")", path); if (!(flags & HASH_WRITE_OBJECT)) - hash_sha1_file(sb.buf, sb.len, blob_type, sha1); - else if (write_sha1_file(sb.buf, sb.len, blob_type, sha1)) + hash_sha1_file(sb.buf, sb.len, blob_type, oid->hash); + else if (write_sha1_file(sb.buf, sb.len, blob_type, oid->hash)) return error("%s: failed to insert into database", path); strbuf_release(&sb); break; case S_IFDIR: - return resolve_gitlink_ref(path, "HEAD", sha1); + return resolve_gitlink_ref(path, "HEAD", oid->hash); default: return error("%s: unsupported file type", path); } |