sha1_file: convert index_path and index_fd to struct object_id
Convert these two functions and the functions that underlie them to take
pointers to struct object_id. This is a prerequisite to convert
resolve_gitlink_ref. Fix a stray tab in the middle of the index_mem
call in index_pipe by converting it to a space.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
brian m. carlson7 years agocommitted byJunio C Hamano
ret = index_mem(sha1, buf, size, type, path, flags);
ret = index_mem(oid, buf, size, type, path, flags);
munmap(buf, size);
}
return ret;
@ -1802,12 +1802,12 @@ int index_fd(struct object_id *oid, int fd, struct stat *st,
@@ -1802,12 +1802,12 @@ int index_fd(struct object_id *oid, 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(oid->hash, fd, path, flags);
ret = index_stream_convert_blob(oid, fd, path, flags);
else if (!S_ISREG(st->st_mode))
ret = index_pipe(oid->hash, fd, type, path, flags);
ret = index_pipe(oid, 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(oid->hash, fd, xsize_t(st->st_size), type, path,
ret = index_core(oid, fd, xsize_t(st->st_size), type, path,
flags);
else
ret = index_stream(oid, fd, xsize_t(st->st_size), type, path,