vendor/libgit2/src/libgit2/iterator.c in rugged-1.5.1 vs vendor/libgit2/src/libgit2/iterator.c in rugged-1.6.2
- old
+ new
@@ -1269,21 +1269,21 @@
{
git_str fullpath = GIT_STR_INIT;
int error;
if (S_ISDIR(entry->st.st_mode)) {
- memset(&entry->id, 0, GIT_OID_RAWSZ);
+ memset(&entry->id, 0, GIT_OID_SHA1_SIZE);
return 0;
}
if (iter->base.type == GIT_ITERATOR_WORKDIR)
return git_repository_hashfile(&entry->id,
iter->base.repo, entry->path, GIT_OBJECT_BLOB, NULL);
if (!(error = git_str_joinpath(&fullpath, iter->root, entry->path)) &&
!(error = git_path_validate_str_length(iter->base.repo, &fullpath)))
- error = git_odb_hashfile(&entry->id, fullpath.ptr, GIT_OBJECT_BLOB);
+ error = git_odb__hashfile(&entry->id, fullpath.ptr, GIT_OBJECT_BLOB, GIT_OID_SHA1);
git_str_dispose(&fullpath);
return error;
}
@@ -1527,9 +1527,11 @@
iter->entry.gid = entry->st.st_gid;
iter->entry.file_size = (uint32_t)entry->st.st_size;
if (iter->base.flags & GIT_ITERATOR_INCLUDE_HASH)
git_oid_cpy(&iter->entry.id, &entry->id);
+ else
+ git_oid_clear(&iter->entry.id, GIT_OID_SHA1);
iter->entry.path = entry->path;
iter->current_is_ignored = GIT_IGNORE_UNCHECKED;
}