@ -280,7 +280,7 @@ static int add_one_path(const struct cache_entry *old, const char *path, int len
@@ -280,7 +280,7 @@ static int add_one_path(const struct cache_entry *old, const char *path, int len
@ -3638,21 +3638,21 @@ int index_fd(unsigned char *sha1, int fd, struct stat *st,
@@ -3638,21 +3638,21 @@ int index_fd(unsigned char *sha1, int fd, struct stat *st,
* die() for large files.
*/
if (type == OBJ_BLOB && path && would_convert_to_git_filter_fd(path))
ret = index_stream_convert_blob(sha1, fd, path, flags);
ret = index_stream_convert_blob(oid->hash, fd, path, flags);
else if (!S_ISREG(st->st_mode))
ret = index_pipe(sha1, fd, type, path, flags);
ret = index_pipe(oid->hash, fd, type, path, flags);
else if (st->st_size <= big_file_threshold || type != OBJ_BLOB ||
(path && would_convert_to_git(&the_index, path)))
ret = index_core(sha1, fd, xsize_t(st->st_size), type, path,
ret = index_core(oid->hash, fd, xsize_t(st->st_size), type, path,
flags);
else
ret = index_stream(sha1, fd, xsize_t(st->st_size), type, path,
ret = index_stream(oid, fd, xsize_t(st->st_size), type, path,
flags);
close(fd);
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;
@ -3662,7 +3662,7 @@ int index_path(unsigned char *sha1, const char *path, struct stat *st, unsigned
@@ -3662,7 +3662,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, fd, st, OBJ_BLOB, path, flags) < 0)
return error("%s: failed to insert into database",
path);
break;
@ -3670,14 +3670,14 @@ int index_path(unsigned char *sha1, const char *path, struct stat *st, unsigned
@@ -3670,14 +3670,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))