Commit Diff


commit - e09adfa5ab72336ded39d57588f963d262893b0e
commit + 9ca4ae7cc53a2209cc77cb16b81545fd15dcc192
blob - c6640bf4b974ae506f61be260b0234eaa468bcf8
blob + c56883ad0f91703cce8de8e4befd755c5431b45e
--- lib/pack.c
+++ lib/pack.c
@@ -355,10 +355,9 @@ got_packidx_open(struct got_packidx **packidx,
 	 * the existence of lonely pack index files but we do not.
 	 */
 	if (fstatat(dir_fd, pack_relpath, &pack_sb, 0) == -1) {
-		if (errno == ENOENT) {
-			err = got_error_fmt(GOT_ERR_LONELY_PACKIDX,
-			    "%s", relpath);
-		} else
+		if (errno == ENOENT)
+			err = got_error_path(relpath, GOT_ERR_LONELY_PACKIDX);
+		else
 			err = got_error_from_errno2("fstatat", pack_relpath);
 		goto done;
 	}