Skip to content

TreeDefinition: allow Add a blob by ID #1519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 27, 2017
Merged

Conversation

ethomson
Copy link
Member

Allow consumers to add a blob to a TreeDefinition by specifying only the object ID and mode. This lets users build tree entries without having to create a Blob object (and thus load the object itself) which is beneficial for users building trees with large objects.

This is only useful for Blobs, since they do not need to be fetched from the object database to be realized within the tree builder. Users are not able to add Trees by ID, since we would need to load them (and cannot, since we are not guaranteed to be instantiated within the context of a repository).

See #1515

Allow consumers to add a blob to a `TreeDefinition` by specifying only
the object ID and mode.  This lets users build tree entries without
having to create a `Blob` object (and thus load the object itself)
which is beneficial for users building trees with large objects.

This is only useful for Blobs, since they do not need to be fetched from
the object database to be realized within the tree builder.  Users are
not able to add Trees by ID, since we would need to load them (and
cannot, since we are not guaranteed to be instantiated within the
context of a repository).
@ethomson
Copy link
Member Author

I don't love the asymmetry here (ie, that you cannot add a Tree by its ID) but I would like to do some bigger refactoring on this class later. Until then, I'm going to :shipit: this.

@ethomson ethomson merged commit 69578ca into master Nov 27, 2017
@ethomson ethomson deleted the ethomson/tree_entries_by_id branch February 15, 2019 09:08
alex-weaver pushed a commit to alex-weaver/libgit2sharp that referenced this pull request Mar 23, 2023
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.

1 participant