summaryrefslogtreecommitdiff
path: root/src/commit.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Add unit tests for Commit parsingVicent Marti2010-06-021-0/+3
| | | | | | | | | | | | | | A few initial tests for commit parsing: "parse_buffer_test" tests git_commit__parse_buffer() with several malformed commit messages and a few corner cases which should pass. "parse_oid_test" tests git_commit__parse_oid() with several malformed commit lines containing broken SHA1 OIDs. Signed-off-by: Vicent Marti <tanoku@gmail.com> Signed-off-by: Andreas Ericsson <ae@op5.se>
* Fixed indentation issues in commit.cVicent Marti2010-06-021-8/+9
| | | | | Signed-off-by: Vicent Marti <tanoku@gmail.com> Signed-off-by: Andreas Ericsson <ae@op5.se>
* Add basic functionality for commit lookup/parsingVicent Marti2010-06-021-0/+118
| | | | | | | | | | | | | | | | | | | | The external API function "git_commit_parse" has been renamed to "git_commit_lookup" and has been partially implemented with support for loading commits straight from the ODB. It still lacks the functionality to lookup cached commits in the revpool and to resolve tags to commits. The following internal functions have been partially implemented: int git_commit__parse_buffer(...); int git_commit__parse_time(...); int git_commit__parse_oid(...); Commits are now fully parsed but the generated parent and tree references are not handled yet. Signed-off-by: Vicent Marti <tanoku@gmail.com> Signed-off-by: Andreas Ericsson <ae@op5.se>
* Wrap malloc and friends and report out of memory as GIT_ENOMEMShawn O. Pearce2008-12-301-0/+1
| | | | | | | | | | | | | | | | We now forbid direct use of malloc, strdup or calloc within the library and instead use wrapper functions git__malloc, etc. to invoke the underlying library malloc and set git_errno to a no memory error code if the allocation fails. In the future once we have pack objects in memory we are likely to enhance these routines with garbage collection logic to purge cached pack data when allocations fail. Because the size of the function will grow somewhat large, we don't want to mark them for inline as gcc tends to aggressively inline, creating larger than expected executables. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Get rid of GIT__PRIVATE macroAndreas Ericsson2008-11-221-1/+1
| | | | | | | | | | | | | Using it in the first place means something's wrong. This patch replaces it with an internal header which carries the previously "protected" code instead. Internal source-files simply include "commit.h" and they're done. The internal header includes the public one to make sure we always use the proper prototype. Signed-off-by: Andreas Ericsson <ae@op5.se> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Switch the license from BSD to GPL+libgcc exceptionShawn O. Pearce2008-11-011-29/+19
| | | | Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Move include files to include/git/, drop git_ prefix from file namesShawn O. Pearce2008-11-011-0/+41
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>