Commit Diff


commit - abda67d236225bf3dbd811ef21bbb4ee5cc776cf
commit + 57cafc2c8d2cc3945d19d99980c58a2b332db572
blob - f406126feba64545994a0f2df7813d09b3fcf5b3
blob + dd5ddd66791e34aeb23a083a5a7f1b44d0072483
--- gotwebd/gotweb.c
+++ gotwebd/gotweb.c
@@ -196,7 +196,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;
 	}
 
@@ -824,7 +824,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 - b3c25e4d161c86c2d9438b113e62c0577cd113d0
blob + 9bddd3a51e1ec80f257cfd9ed273feb7625ab9c3
--- lib/repository.c
+++ lib/repository.c
@@ -1400,8 +1400,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)
@@ -1846,8 +1851,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);
 
@@ -2596,8 +2606,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;