From 3ff9a4e468a687206478cd1b1d5857ccfecc2434 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Mon, 12 Jun 2017 12:01:10 +0100 Subject: 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. --- src/repository.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.1