Commit 46811561ae19701d4d0fc4b00113667f81961dfc

nulltoken 2012-05-07T13:56:42

path: Make git_path_prettify() properly handle ENOTDIR errno value

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/path.c b/src/path.c
index 703f43a..ccf80ed 100644
--- a/src/path.c
+++ b/src/path.c
@@ -207,7 +207,7 @@ int git_path_prettify(git_buf *path_out, const char *path, const char *base)
 	if (p_realpath(path, buf) == NULL) {
 		giterr_set(GITERR_OS, "Failed to resolve path '%s'", path);
 		git_buf_clear(path_out);
-		return (errno == ENOENT) ? GIT_ENOTFOUND : -1;
+		return (errno == ENOENT || errno == ENOTDIR) ? GIT_ENOTFOUND : -1;
 	}
 
 	return git_buf_sets(path_out, buf);