Skip to content

Add Odb.read_header; Have Odb.read return ObjectType enum#1450

Merged
jdavid merged 3 commits intolibgit2:masterfrom
jorio:odb.read_header
Mar 3, 2026
Merged

Add Odb.read_header; Have Odb.read return ObjectType enum#1450
jdavid merged 3 commits intolibgit2:masterfrom
jorio:odb.read_header

Conversation

@jorio
Copy link
Contributor

@jorio jorio commented Mar 2, 2026

This PR adds two things:

  • Odb.read_header binds libgit2's git_odb_read_header
  • Odb.read now returns an ObjectType enum value instead of a simple int

When you've got the hash for a blob and you just need to know its size without reading its contents, Odb.read_header can be more efficient than looking up the Blob object in the repo (especially for large blobs).

@jdavid jdavid merged commit 555b1f3 into libgit2:master Mar 3, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants