Commit 7ecc73af19d2c370aa43beb6db4157289013aa0c

Tracey Emery 2020-02-13T23:49:31

ensure we close the final checked dir in gw_load_got_path and use better error message

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index 0235b8d..63acb73 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -1542,9 +1542,10 @@ gw_load_got_path(struct gw_trans *gw_trans, struct gw_dir *gw_dir)
 
 	dt = opendir(dir_test);
 	if (dt == NULL) {
-		error = got_error(GOT_ERR_NOT_GIT_REPO);
+		error = got_error_from_errno2("bad path", dir_test);
 		goto errored;
-	}
+	} else
+		opened = 1;
 done:
 	error = gw_get_repo_description(&gw_dir->description, gw_trans,
 	    gw_dir->path);