]> git.proxmox.com Git - libgit2.git/commitdiff
Return a specific error for EACCES.
authorAlan Rogers <alan@github.com>
Thu, 15 May 2014 06:54:46 +0000 (16:54 +1000)
committerAlan Rogers <alan@github.com>
Thu, 15 May 2014 06:54:46 +0000 (16:54 +1000)
include/git2/errors.h
src/path.c

index e22f0d86d16c1d1f6c2193be8700462627e2ecc1..f09e72566018961e1642b7ac917072005ef63038 100644 (file)
@@ -41,6 +41,7 @@ typedef enum {
        GIT_EMERGECONFLICT  = -13,      /*< Merge conflicts prevented operation */
        GIT_ELOCKED         = -14,      /*< Lock file prevented operation */
        GIT_EMODIFIED       = -15,      /*< Reference value does not match expected */
+       GIT_ENOACCESS       = -16,      /*< Access denied attempting operation */
 
        GIT_PASSTHROUGH     = -30,      /*< Internal only */
        GIT_ITEROVER        = -31,      /*< Signals end of iteration with iterator */
index e0b00a086c165c1de30b884dd0e2382540614e08..55790ff7caaeed881891a377b701b0fcb08e5ce3 100644 (file)
@@ -561,6 +561,10 @@ int git_path_set_error(int errno_value, const char *path, const char *action)
                giterr_set(GITERR_OS, "Failed %s - '%s' already exists", action, path);
                return GIT_EEXISTS;
 
+       case EACCES:
+               giterr_set(GITERR_OS, "Failed %s - '%s' permission denied", action, path);
+               return GIT_ENOACCESS;
+
        default:
                giterr_set(GITERR_OS, "Could not %s '%s'", action, path);
                return -1;