diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2017-06-12 12:01:10 +0100 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2017-06-12 12:01:10 +0100 |
commit | 3ff9a4e468a687206478cd1b1d5857ccfecc2434 (patch) | |
tree | 045af06e9e2975d58c2bd7722798c04eddb6061e | |
parent | ff47cf4d043c9cdf3de73c760a59417cc77efcd2 (diff) | |
download | libgit2-3ff9a4e468a687206478cd1b1d5857ccfecc2434.tar.gz |
repository_item_path: return ENOTFOUND when appropriate
Disambiguate error values: return `GIT_ENOTFOUND` when the item cannot
exist in the repository (perhaps because the repository is inmemory or
otherwise not backed by a filesystem), return `-1` when there is a hard
failure.
-rw-r--r-- | src/repository.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/repository.c b/src/repository.c index 9729d3197..27553ad0a 100644 --- a/src/repository.c +++ b/src/repository.c @@ -2272,7 +2272,7 @@ int git_repository_item_path(git_buf *out, git_repository *repo, git_repository_ if (parent == NULL) { giterr_set(GITERR_INVALID, "path cannot exist in repository"); - return -1; + return GIT_ENOTFOUND; } if (git_buf_sets(out, parent) < 0) |