Commit Diff


commit - 5d0baf4e3f639af9dcfcde4e24f9db7aa72332c3
commit + 05f7204b7c26d432547753965bf1a27fb7fb2e01
blob - ea44d67c0df8c731d5a45b797add4cbee60f171c
blob + ff01852b75f3531996e1e87a3c719dbe369b65d9
--- gotwebd/gotweb.c
+++ gotwebd/gotweb.c
@@ -197,7 +197,7 @@ gotweb_process_request(struct request *c)
 	if (qs->action != INDEX) {
 		error = gotweb_load_got_path(&repo_dir, qs->path, c);
 		c->t->repo_dir = repo_dir;
-		if (error && error->code != GOT_ERR_LONELY_PACKIDX)
+		if (error)
 			goto err;
 	}
 
@@ -825,7 +825,7 @@ gotweb_render_index(struct template *tp)
 
 		error = gotweb_load_got_path(&repo_dir, sd_dent[d_i]->d_name,
 		    c);
-		if (error && error->code != GOT_ERR_LONELY_PACKIDX) {
+		if (error) {
 			if (error->code != GOT_ERR_NOT_GIT_REPO)
 				log_warnx("%s: %s: %s", __func__,
 				    sd_dent[d_i]->d_name, error->msg);
blob - f6c9b881e64ee0270d643a9dc809378060318b2b
blob + 4a2aa626c6bfeafe49ae89b98803e3ba71f9ba15
--- lib/repository.c
+++ lib/repository.c
@@ -1404,8 +1404,13 @@ got_repo_search_packidx(struct got_packidx **packidx, 
 
 		err = got_packidx_open(packidx, got_repo_get_fd(repo),
 		    path_packidx, 0, repo->algo);
-		if (err)
+		if (err) {
+			if (err->code == GOT_ERR_LONELY_PACKIDX) {
+				err = NULL;
+				continue;
+			}
 			goto done;
+		}
 
 		err = add_packidx_bloom_filter(repo, *packidx, path_packidx);
 		if (err)
@@ -1849,8 +1854,13 @@ retry:
 
 		err = got_packidx_open(&packidx, got_repo_get_fd(repo),
 		    path_packidx, 0, repo->algo);
-		if (err)
+		if (err) {
+			if (err->code == GOT_ERR_LONELY_PACKIDX) {
+				err = NULL;
+				continue;
+			}
 			break;
+		}
 
 		got_object_id_queue_free(&matched_ids);
 
@@ -2598,8 +2608,13 @@ got_repo_get_packfile_info(int *npackfiles, int *nobje
 		err = got_packidx_open(&packidx, got_repo_get_fd(repo),
 		    path_packidx, 0, repo->algo);
 		free(path_packidx);
-		if (err)
+		if (err) {
+			if (err->code == GOT_ERR_LONELY_PACKIDX) {
+				err = NULL;
+				continue;
+			}
 			goto done;
+		}
 
 		if (fstat(packidx->fd, &sb) == -1)
 			goto done;