From dbb36e1b42de2b65b3ea98501dc6aae754acd744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Thu, 17 May 2012 17:56:49 +0200 Subject: ssl: check certificates against the system's trusted CAs --- include/git2/errors.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index fb6670004..ccbc9fcf4 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -88,6 +88,7 @@ typedef enum { GITERR_TAG, GITERR_TREE, GITERR_INDEXER, + GITERR_SSL, } git_error_t; /** -- cgit v1.2.1 From 519757279eb25fe4075f65b86da5ce52d352b454 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 7 Jun 2012 23:13:39 +0100 Subject: Fix double-defines when using GIT_OLD_ERRORS --- include/git2/errors.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index ccbc9fcf4..b4809fe15 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -20,6 +20,7 @@ GIT_BEGIN_DECL #ifdef GIT_OLD_ERRORS enum { GIT_SUCCESS = 0, + GIT_ERROR = -1, GIT_ENOTOID = -2, GIT_ENOTFOUND = -3, GIT_ENOMEM = -4, @@ -52,7 +53,7 @@ enum { GIT_ENOMATCH = -31, GIT_ESHORTBUFFER = -32, }; -#endif +#else /** Generic return codes */ enum { @@ -66,6 +67,7 @@ enum { GIT_PASSTHROUGH = -30, GIT_REVWALKOVER = -31, }; +#endif typedef struct { char *message; -- cgit v1.2.1 From 798e4d53dcd2f5340782083130c0fb5227d596ac Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Fri, 22 Jun 2012 21:25:17 +0200 Subject: amigaos: Cleanup --- include/git2/errors.h | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index b4809fe15..ca7f0de6e 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -17,44 +17,6 @@ */ GIT_BEGIN_DECL -#ifdef GIT_OLD_ERRORS -enum { - GIT_SUCCESS = 0, - GIT_ERROR = -1, - GIT_ENOTOID = -2, - GIT_ENOTFOUND = -3, - GIT_ENOMEM = -4, - GIT_EOSERR = -5, - GIT_EOBJTYPE = -6, - GIT_ENOTAREPO = -7, - GIT_EINVALIDTYPE = -8, - GIT_EMISSINGOBJDATA = -9, - GIT_EPACKCORRUPTED = -10, - GIT_EFLOCKFAIL = -11, - GIT_EZLIB = -12, - GIT_EBUSY = -13, - GIT_EBAREINDEX = -14, - GIT_EINVALIDREFNAME = -15, - GIT_EREFCORRUPTED = -16, - GIT_ETOONESTEDSYMREF = -17, - GIT_EPACKEDREFSCORRUPTED = -18, - GIT_EINVALIDPATH = -19, - GIT_EREVWALKOVER = -20, - GIT_EINVALIDREFSTATE = -21, - GIT_ENOTIMPLEMENTED = -22, - GIT_EEXISTS = -23, - GIT_EOVERFLOW = -24, - GIT_ENOTNUM = -25, - GIT_ESTREAM = -26, - GIT_EINVALIDARGS = -27, - GIT_EOBJCORRUPTED = -28, - GIT_EAMBIGUOUS = -29, - GIT_EPASSTHROUGH = -30, - GIT_ENOMATCH = -31, - GIT_ESHORTBUFFER = -32, -}; -#else - /** Generic return codes */ enum { GIT_OK = 0, @@ -67,13 +29,13 @@ enum { GIT_PASSTHROUGH = -30, GIT_REVWALKOVER = -31, }; -#endif typedef struct { char *message; int klass; } git_error; +/** Error classes */ typedef enum { GITERR_NOMEMORY, GITERR_OS, -- cgit v1.2.1 From 5dca201072724e4230141796d7c9f8836a277de8 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Fri, 3 Aug 2012 17:08:01 -0700 Subject: Update iterators for consistency across library This updates all the `foreach()` type functions across the library that take callbacks from the user to have a consistent behavior. The rules are: * A callback terminates the loop by returning any non-zero value * Once the callback returns non-zero, it will not be called again (i.e. the loop stops all iteration regardless of state) * If the callback returns non-zero, the parent fn returns GIT_EUSER * Although the parent returns GIT_EUSER, no error will be set in the library and `giterr_last()` will return NULL if called. This commit makes those changes across the library and adds tests for most of the iteration APIs to make sure that they follow the above rules. --- include/git2/errors.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index ca7f0de6e..2ab1da403 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -25,6 +25,7 @@ enum { GIT_EEXISTS = -4, GIT_EAMBIGUOUS = -5, GIT_EBUFS = -6, + GIT_EUSER = -7, GIT_PASSTHROUGH = -30, GIT_REVWALKOVER = -31, -- cgit v1.2.1 From aa13bf05c84f10f364ce35c5d4f989337b36e043 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Thu, 2 Aug 2012 13:00:58 -0700 Subject: Major submodule rewrite This replaces the old submodule API with a new extended API that supports most of the things that can be done with `git submodule`. --- include/git2/errors.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index 2ab1da403..b55f8c30d 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -54,6 +54,7 @@ typedef enum { GITERR_TREE, GITERR_INDEXER, GITERR_SSL, + GITERR_SUBMODULE, } git_error_t; /** -- cgit v1.2.1 From f335ecd6e126aa9dea28786522c0e6ce71596e91 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Thu, 30 Aug 2012 14:24:16 -0700 Subject: Diff iterators This refactors the diff output code so that an iterator object can be used to traverse and generate the diffs, instead of just the `foreach()` style with callbacks. The code has been rearranged so that the two styles can still share most functions. This also replaces `GIT_REVWALKOVER` with `GIT_ITEROVER` and uses that as a common error code for marking the end of iteration when using a iterator style of object. --- include/git2/errors.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index b55f8c30d..f6671c49d 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -28,7 +28,7 @@ enum { GIT_EUSER = -7, GIT_PASSTHROUGH = -30, - GIT_REVWALKOVER = -31, + GIT_ITEROVER = -31, }; typedef struct { -- cgit v1.2.1 From bb2d305c20d62b10b39d95916d1a172057c26d65 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Wed, 22 Aug 2012 10:47:25 +0200 Subject: errors: introduce GIT_EBAREREPO --- include/git2/errors.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index f6671c49d..e5f435926 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -26,6 +26,7 @@ enum { GIT_EAMBIGUOUS = -5, GIT_EBUFS = -6, GIT_EUSER = -7, + GIT_EBAREREPO = -8, GIT_PASSTHROUGH = -30, GIT_ITEROVER = -31, -- cgit v1.2.1 From 1a628100534a315bd00361fc3d32df671923c107 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Fri, 21 Sep 2012 15:04:39 -0700 Subject: Make giterr_set_str public There has been discussion for a while about making some set of the `giterr_set` type functions part of the public API for code that is implementing new backends to libgit2. This makes the `giterr_set_str()` and `giterr_set_oom()` functions public. --- include/git2/errors.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index e5f435926..f6d9bf2e3 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -71,6 +71,40 @@ GIT_EXTERN(const git_error *) giterr_last(void); */ GIT_EXTERN(void) giterr_clear(void); +/** + * Set the error message string for this thread. + * + * This function is public so that custom ODB backends and the like can + * relay an error message through libgit2. Most regular users of libgit2 + * will never need to call this function -- actually, calling it in most + * circumstances (for example, calling from within a callback function) + * will just end up having the value overwritten by libgit2 internals. + * + * This error message is stored in thread-local storage and only applies + * to the particular thread that this libgit2 call is made from. + * + * NOTE: Passing the `error_class` as GITERR_OS has a special behavior: we + * attempt to append the system default error message for the last OS error + * that occurred and then clear the last error. The specific implementation + * of looking up and clearing this last OS error will vary by platform. + * + * @param error_class One of the `git_error_t` enum above describing the + * general subsystem that is responsible for the error. + * @param message The formatted error message to keep + */ +GIT_EXTERN(void) giterr_set_str(int error_class, const char *string); + +/** + * Set the error message to a special value for memory allocation failure. + * + * The normal `giterr_set_str()` function attempts to `strdup()` the string + * that is passed in. This is not a good idea when the error in question + * is a memory allocation failure. That circumstance has a special setter + * function that sets the error string to a known and statically allocated + * internal value. + */ +GIT_EXTERN(void) giterr_set_oom(void); + /** @} */ GIT_END_DECL #endif -- cgit v1.2.1 From 0a32dca5ecbd4c56b02ba78af4174ac7f65a786c Mon Sep 17 00:00:00 2001 From: Michael Schubert Date: Sun, 19 Aug 2012 22:26:32 +0200 Subject: gsoc-pack-objects WIP --- include/git2/errors.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index f6d9bf2e3..1c4e910a6 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -56,6 +56,7 @@ typedef enum { GITERR_INDEXER, GITERR_SSL, GITERR_SUBMODULE, + GITERR_THREAD, } git_error_t; /** -- cgit v1.2.1 From c4f68b3503ea37fc179fccfc49bb17469bd7ff70 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Fri, 19 Oct 2012 11:04:32 +0200 Subject: errors: introduce GIT_EORPHANEDHEAD --- include/git2/errors.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index 1c4e910a6..38b7fe0ae 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -27,6 +27,7 @@ enum { GIT_EBUFS = -6, GIT_EUSER = -7, GIT_EBAREREPO = -8, + GIT_EORPHANEDHEAD = -9, GIT_PASSTHROUGH = -30, GIT_ITEROVER = -31, -- cgit v1.2.1 From 03bdb2addd02948e0e42b509e5c26c6eb5e7e1de Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Tue, 23 Oct 2012 16:32:01 -0500 Subject: GIT_EUNMERGED --- include/git2/errors.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index 38b7fe0ae..fb56dcc6b 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -28,6 +28,7 @@ enum { GIT_EUSER = -7, GIT_EBAREREPO = -8, GIT_EORPHANEDHEAD = -9, + GIT_EUNMERGED = -10, GIT_PASSTHROUGH = -30, GIT_ITEROVER = -31, -- cgit v1.2.1 From eb44cfe07b16e5680c50c13cee79859455b90803 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Mon, 8 Oct 2012 15:49:31 +0200 Subject: error: add GITERR_STASH error type --- include/git2/errors.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index fb56dcc6b..8bb47f354 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -59,6 +59,7 @@ typedef enum { GITERR_SSL, GITERR_SUBMODULE, GITERR_THREAD, + GITERR_STASH, } git_error_t; /** -- cgit v1.2.1 From ad9a921b92a964a0f28a5f0d59079cde5a0ada1e Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Thu, 8 Nov 2012 17:05:07 -0800 Subject: Rework checkout with new strategy options This is a major reworking of checkout strategy options. The checkout code is now sensitive to the contents of the HEAD tree and the new options allow you to update the working tree so that it will match the index content only when it previously matched the contents of the HEAD. This allows you to, for example, to distinguish between removing files that are in the HEAD but not in the index, vs just removing all untracked files. Because of various corner cases that arise, etc., this required some additional capabilities in rmdir and other utility functions. This includes the beginnings of an implementation of code to read a partial tree into the index based on a pathspec, but that is not enabled because of the possibility of creating conflicting index entries. --- include/git2/errors.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index 8bb47f354..45e04578d 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -60,6 +60,7 @@ typedef enum { GITERR_SUBMODULE, GITERR_THREAD, GITERR_STASH, + GITERR_CHECKOUT, } git_error_t; /** -- cgit v1.2.1 From 613d5eb9391d6cc33c91f4dc9cdb5ede1885dc72 Mon Sep 17 00:00:00 2001 From: Philip Kelley Date: Wed, 28 Nov 2012 11:42:37 -0500 Subject: Push! By schu, phkelley, and congyiwu, et al --- include/git2/errors.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index 45e04578d..9dd42f0c4 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -29,6 +29,7 @@ enum { GIT_EBAREREPO = -8, GIT_EORPHANEDHEAD = -9, GIT_EUNMERGED = -10, + GIT_ENONFASTFORWARD = -11, GIT_PASSTHROUGH = -30, GIT_ITEROVER = -31, -- cgit v1.2.1 From 8b50935a69c4e69f9975bad11caeb0ba04adec85 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Mon, 12 Nov 2012 11:29:48 +0100 Subject: errors: Introduce EINVALIDSPEC error code --- include/git2/errors.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index 9dd42f0c4..63b6bc8ee 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -30,6 +30,7 @@ enum { GIT_EORPHANEDHEAD = -9, GIT_EUNMERGED = -10, GIT_ENONFASTFORWARD = -11, + GIT_EINVALIDSPEC = -12, GIT_PASSTHROUGH = -30, GIT_ITEROVER = -31, -- cgit v1.2.1 From 7fcec8342890031a0d22f0d013833badd81091e8 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Tue, 11 Dec 2012 22:31:21 -0600 Subject: fetchhead reading/iterating --- include/git2/errors.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index 63b6bc8ee..8ca900969 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -63,6 +63,7 @@ typedef enum { GITERR_THREAD, GITERR_STASH, GITERR_CHECKOUT, + GITERR_FETCHHEAD, } git_error_t; /** -- cgit v1.2.1 From 42e50b5ed10fcebab794d35cefa1eedcd79072b6 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Thu, 3 Jan 2013 12:44:09 -0600 Subject: MERGE_HEAD contents iterator --- include/git2/errors.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index 8ca900969..4eb9e94ef 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -64,6 +64,7 @@ typedef enum { GITERR_STASH, GITERR_CHECKOUT, GITERR_FETCHHEAD, + GITERR_MERGE, } git_error_t; /** -- cgit v1.2.1 From 359fc2d241ac407bdf9bf0d28715705f01ca6360 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Tue, 8 Jan 2013 17:07:25 -0600 Subject: update copyrights --- include/git2/errors.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index 4eb9e94ef..9e0a1a9e6 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2012 the libgit2 contributors + * Copyright (C) the libgit2 contributors. All rights reserved. * * This file is part of libgit2, distributed under the GNU GPL v2 with * a Linking Exception. For full terms see the included COPYING file. -- cgit v1.2.1 From 635c235cf320428775529285bebf6f238fc71184 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Thu, 10 Jan 2013 12:11:49 +0100 Subject: errors: Introduce EMERGECONFLICT error code --- include/git2/errors.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index 9e0a1a9e6..917f0699c 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -31,6 +31,7 @@ enum { GIT_EUNMERGED = -10, GIT_ENONFASTFORWARD = -11, GIT_EINVALIDSPEC = -12, + GIT_EMERGECONFLICT = -13, GIT_PASSTHROUGH = -30, GIT_ITEROVER = -31, -- cgit v1.2.1