diff options
| author | Vicent Martà <vicent@github.com> | 2012-09-13 09:24:12 -0700 |
|---|---|---|
| committer | Vicent Martà <vicent@github.com> | 2012-09-13 09:24:12 -0700 |
| commit | 9be2261eaae74552aaa9d568e663292f4382e141 (patch) | |
| tree | fe9711595f4fe21e86989efcbd374ddb7bb5d157 /src/odb.c | |
| parent | 45c4697c48e50951a383f93d63ad0c192915df8c (diff) | |
| parent | a13fb55afdbf9d74c3d4b6aa76476a005da49486 (diff) | |
| download | libgit2-9be2261eaae74552aaa9d568e663292f4382e141.tar.gz | |
Merge pull request #927 from arrbee/hashfile-with-filters
Add git_repository_hashfile to hash with filters
Diffstat (limited to 'src/odb.c')
| -rw-r--r-- | src/odb.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -117,6 +117,11 @@ int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_otype type) git_hash_ctx *ctx; ssize_t read_len = -1; + if (!git_object_typeisloose(type)) { + giterr_set(GITERR_INVALID, "Invalid object type for hash"); + return -1; + } + hdr_len = format_object_header(hdr, sizeof(hdr), size, type); ctx = git_hash_new_ctx(); |
