src/errors.c


Log

Author Commit Date CI Message
nulltoken 6a0895ad 2011-02-11T13:58:40 Added GIT_EINVALIDREFSTATE error.
Vicent Marti c836c332 2011-02-05T09:29:37 Make more methods return error codes git_revwalk_next now returns an error code when the iteration is over. git_repository_index now returns an error code when the index file could not be opened. Signed-off-by: Vicent Marti <tanoku@gmail.com>
nulltoken 9282e921 2010-12-27T20:34:19 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.
nulltoken f2c24713 2011-01-26T20:29:06 Made path prettifying functions return GIT_EINVALIDPATH instead of GIT_ERROR.
Vicent Marti 9f54fe48 2010-12-23T00:15:09 Remove git_errno It was not being used by any methods (only by malloc and calloc), and since it needs to be TLS, it cannot be exported on DLLs on Windows. Burn it with fire. The API always returns error codes! Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti a8bfce69 2010-11-05T03:50:24 Add string descriptions for all error codes Old descriptions have been updated and new ones have been added for the 'git_strerror' function. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Ramsay Jones 0ef9d2aa 2010-01-03T22:56:54 Fix some "signed v unsigned comparison" warnings with -Wextra Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Shawn O. Pearce 7dd8a9f7 2008-12-30T23:26:38 Set GIT_EOSERR when the OS errno should be consulted This error code indicates the OS error code has a better value describing the last error, as it is likely a network or local file IO problem identified by a C library function call. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce 64a47c01 2008-12-30T23:21:36 Wrap malloc and friends and report out of memory as GIT_ENOMEM 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>
Shawn O. Pearce a1d34bc0 2008-12-30T21:49:38 Support building on Mac OS X by using pthread_getspecific for TLS The Mach-O format does not permit gcc to implement the __thread TLS specification, so we must instead emulate it using a single int cell allocated from memory and stored inside of the thread specific data associated with the current pthread. What makes this tricky is git_errno must be a valid lvalue, so we really need to return a pointer to the caller and deference it as part of the git_errno macro. The GCC-specific __attribute__((constructor)) extension is used to ensure the pthread_key_t is allocated before any Git functions are executed in the library, as this is necessary to access our thread specific storage. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Andreas Ericsson ae234862 2008-11-18T22:20:15 Add an embryo of a TLS-aware error handling system This adds the per-thread global variable git_errno to the system, which callers can examine to get information about an error. Two helper functions are added to reduce LoC-count for the library code itself. Also, some exceptions are made for running sparse on GIT_TLS definitions, since it doesn't grok thread-local variables at all. Signed-off-by: Andreas Ericsson <ae@op5.se> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>