Skip to content

Commit

Permalink
Use oidread instead of hashcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Jul 27, 2024
1 parent 79e8cbe commit f78ba98
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/cinnabar-fast-import.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ off_t find_pack_entry_one(const unsigned char *sha1, struct packed_git *p)
if (p == pack_data) {
struct object_id oid;
struct object_entry *oe;
hashcpy(oid.hash, sha1);
oid.algo = GIT_HASH_SHA1;
oidread(&oid, sha1);
oe = get_object_entry(&oid);
if (oe)
return oe->idx.offset;
Expand Down
3 changes: 1 addition & 2 deletions src/cinnabar-notes.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ int cinnabar_remove_note(struct cinnabar_notes_tree *t,
int result2 = remove_note(&t->additions, object_sha1);
if (!result) {
struct object_id oid;
hashcpy(oid.hash, object_sha1);
oid.algo = GIT_HASH_SHA1;
oidread(&oid, object_sha1);
add_note(&t->additions, &oid, null_oid(), NULL);
}
return result && result2;
Expand Down

0 comments on commit f78ba98

Please sign in to comment.