summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Rogers <alan@github.com>2014-05-15 16:54:46 +1000
committerAlan Rogers <alan@github.com>2014-05-15 16:54:46 +1000
commit158c8ba1ee81fe20d3beb16650f30f3be02054f7 (patch)
treec51113aff1068084dc4d1210b974241aeb8317a5
parent8d3a2d5fc58a08a22e355beaa0f9fc146facc3b3 (diff)
downloadlibgit2-158c8ba1ee81fe20d3beb16650f30f3be02054f7.tar.gz
Return a specific error for EACCES.
-rw-r--r--include/git2/errors.h1
-rw-r--r--src/path.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/include/git2/errors.h b/include/git2/errors.h
index e22f0d86d..f09e72566 100644
--- a/include/git2/errors.h
+++ b/include/git2/errors.h
@@ -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 */
diff --git a/src/path.c b/src/path.c
index e0b00a086..55790ff7c 100644
--- a/src/path.c
+++ b/src/path.c
@@ -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;