summaryrefslogtreecommitdiff
path: root/src/libgit2/iterator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libgit2/iterator.c')
-rw-r--r--src/libgit2/iterator.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libgit2/iterator.c b/src/libgit2/iterator.c
index bc6f766ce..1ee8e25f5 100644
--- a/src/libgit2/iterator.c
+++ b/src/libgit2/iterator.c
@@ -1271,7 +1271,7 @@ static int filesystem_iterator_entry_hash(
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;
}
@@ -1281,7 +1281,7 @@ static int filesystem_iterator_entry_hash(
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;
@@ -1529,6 +1529,8 @@ static void filesystem_iterator_set_current(
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;