Bring back `entry_bypath` #793

Merged
merged 3 commits into from Jul 11, 2012

Conversation

Projects
None yet
5 participants
Owner

vmg commented Jun 29, 2012

Smaller, simpler, faster.

Tree entries can now be returned as constant, or non-constant references. Non-constants are owned by the user, and must be freed manually.

Tree entries are now a shitton of bytes smaller. The attrs variable has been condensed with removed and the filename is now in a vararray. Fast and lean.

The new entry_bypath does not touch the original path, so you no longer need a filebuf.

tree: Bring back `entry_bypath`
Smaller, simpler, faster.

This pull request passes (merged 0e2fcca into cbc02c1).

Owner

carlosmn commented on src/tree.c in 0e2fcca Jun 29, 2012

Why not git_tree_entry_dup? This is the usual C way of calling a function that allocates the copy; we already have "copy/cpy" for function that only do the copying into user-provided memory.

Don't rmdir() nonexistent dirs in object::tree::frompath tests
It causes the clar testsuite to abort on Windows, and isn't necessary.

This pull request passes (merged 7e8c146 into cbc02c1).

Owner

vmg commented Jun 29, 2012

@carlosmn: Renamed.

This pull request passes (merged 46ea40d into cbc02c1).

Member

arrbee commented Jul 10, 2012

I've been using this code locally for the submodule work that I've been hacking on and it all looks good to me. @tanoku (or @carlosmn) is there any outstanding reason not to merge this? I'm going to merge it tonight or tomorrow unless you tell me to hold off.

Member

arrbee commented Jul 11, 2012

This PR is too beautiful. Great solution that keeps the most natural API and solves the problem. ❤️ @tanoku!

arrbee added a commit that referenced this pull request Jul 11, 2012

@arrbee arrbee merged commit 4d3a7b7 into development Jul 11, 2012

Owner

vmg commented Jul 11, 2012

😊

phatblat pushed a commit to phatblat/libgit2 that referenced this pull request Sep 13, 2014

@nulltoken nulltoken deleted the tree-entry-by-path branch Nov 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment