]> git.proxmox.com Git - libgit2.git/commit - tests/libgit2/object/peel.c
Make git_object_peel a bit smarter
authorRussell Belfer <rb@github.com>
Mon, 27 Aug 2012 18:53:59 +0000 (11:53 -0700)
committerRussell Belfer <rb@github.com>
Mon, 27 Aug 2012 18:53:59 +0000 (11:53 -0700)
commitd8057a5b0ed644b1f72a4eb80f82da7ce8977958
tree43c962073e49ff204f92345a2d0713bb56a56ffd
parent2b175ca972f2531e5ef46d24abeb831d90033a33
Make git_object_peel a bit smarter

This expands the types of peeling that `git_object_peel` knows
how to do to include TAG -> BLOB peeling, and makes the errors
slightly more consistent depending on the situation.  It also
adds a new special behavior where peeling to ANY will peel until
the object type changes (e.g. chases TAGs to a non-TAG).

Using this expanded peeling, this replaces peeling code that was
embedded in `git_tag_peel` and `git_reset`.
include/git2/object.h
include/git2/reset.h
src/object.c
src/reset.c
src/tag.c
tests-clar/object/peel.c