Commit 0c2b02061e389f053ba5a61b64f4f6be3144e3aa

Etienne Samson 2019-11-09T09:41:13

fileops: correct error return on p_lstat failures when mkdir IIRC I got a strange return once from lstat, which translated in a weird error class/message being reported. As a safety measure, enforce a -1 return in that case.

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/futils.c b/src/futils.c
index e15c801..7454844 100644
--- a/src/futils.c
+++ b/src/futils.c
@@ -476,6 +476,7 @@ int git_futils_mkdir(
 			break;
 		} else if (errno != ENOENT) {
 			git_error_set(GIT_ERROR_OS, "failed to stat '%s'", parent_path.ptr);
+			error = -1;
 			goto done;
 		}