]> git.proxmox.com Git - libgit2.git/commit
Merge nulltoken's reference parsing code
authornulltoken <emeric.fermas@gmail.com>
Mon, 27 Dec 2010 19:34:19 +0000 (20:34 +0100)
committerVicent Marti <tanoku@gmail.com>
Sat, 29 Jan 2011 01:39:02 +0000 (03:39 +0200)
commit9282e921a394d422188ee43e18a63d418f88ac95
treea26eb65e2b9a3b0ce7f35c7fa47e560c646f418d
parentf2c2471389048b8f930ed945ed1acfe004f901a4
Merge nulltoken's reference parsing code

All the commits have been squashed into a single one before refactoring
the final code, to keep everything tidy.

Individual commit messages are as follows:

Added repository reference looking up functionality placeholder.

Added basic reference database definition and caching infrastructure.

Removed useless constant.

Added GIT_EINVALIDREFNAME error and description. Added missing description for GIT_EBAREINDEX.

Added GIT_EREFCORRUPTED error and description.

Added GIT_ETOONESTEDSYMREF error and description.

Added resolving of direct and symbolic references.

Prepared the packed-refs parsing.

Added parsing of the packed-refs file content.

When no loose reference has been found, the full content of the packed-refs file is parsed. All of the new (i.e. not previously parsed as a loose reference) references are eagerly stored in the cached references storage.

The method packed_reference_file__parse() is in deer need of some refactoring. :-)

Extracted to a method the parsing of the peeled target of a tag.

Extracted to a method the parsing of a standard packed ref.

Fixed leaky removal of the cached references.

Ensured that a previously parsed packed reference isn't returned if a more up-to-date loose reference exists.

Enhanced documentation of git_repository_reference_lookup().

Moved some refs related constants from repository.c to refs.h.

Made parsing of a packed tag reference more robust.

Updated git_repository_reference_lookup() documentation.

Added some references to the test repository.

Added some tests covering tag references looking up.

Added some tests covering symbolic and head references looking up.

Added some tests covering packed references looking up.
20 files changed:
src/errors.c
src/git2/common.h
src/git2/repository.h
src/git2/types.h
src/refs.c [new file with mode: 0644]
src/refs.h [new file with mode: 0644]
src/repository.c
src/repository.h
tests/NAMING
tests/resources/testrepo.git/HEAD
tests/resources/testrepo.git/packed-refs [new file with mode: 0644]
tests/resources/testrepo.git/refs/heads/br2 [new file with mode: 0644]
tests/resources/testrepo.git/refs/heads/master [new file with mode: 0644]
tests/resources/testrepo.git/refs/heads/packed-test [new file with mode: 0644]
tests/resources/testrepo.git/refs/heads/test [new file with mode: 0644]
tests/resources/testrepo.git/refs/tags/test [new file with mode: 0644]
tests/resources/testrepo.git/refs/tags/very-simple [new file with mode: 0644]
tests/t1001-readtag.c [new file with mode: 0644]
tests/t1002-readsymref.c [new file with mode: 0644]
tests/t1003-readpackedref.c [new file with mode: 0644]