Commit aedda007f35a0820009e1463c9c804c6dea9acb1

Stefan Sperling 2019-05-13T17:09:11

make open_ref() tolerate missing reference dirs and files

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/lib/reference.c b/lib/reference.c
index 240d979..02c770e 100644
--- a/lib/reference.c
+++ b/lib/reference.c
@@ -403,7 +403,10 @@ open_ref(struct got_reference **ref, const char *path_refs, const char *subdir,
 
 	normpath = got_path_normalize(path);
 	if (normpath == NULL) {
-		err = got_error_from_errno2("got_path_normalize", path);
+		if (errno == ENOENT)
+			err = NULL;
+		else
+			err = got_error_from_errno2("got_path_normalize", path);
 		goto done;
 	}