Commit 6843859a3bc6129aa748a72b6bb588d575db52cf

Stefan Sperling 2021-07-09T09:45:36

display recovery steps in the lonely pack index error message

diff --git a/include/got_error.h b/include/got_error.h
index f571bc2..eab64a8 100644
--- a/include/got_error.h
+++ b/include/got_error.h
@@ -301,7 +301,8 @@ static const struct got_error {
 	    "version control" },
 	{ GOT_ERR_GIT_REPO_EXT, "unsupported repository format extension" },
 	{ GOT_ERR_CANNOT_PACK, "not enough objects to pack" },
-	{ GOT_ERR_LONELY_PACKIDX, "pack index has no corresponding pack file" },
+	{ GOT_ERR_LONELY_PACKIDX, "pack index has no corresponding pack file; "
+	    "pack file must be restored or 'gotadmin cleanup -p' must be run" },
 	{ GOT_ERR_OBJ_CSUM, "bad object checksum" },
 };
 
diff --git a/regress/cmdline/cleanup.sh b/regress/cmdline/cleanup.sh
index aa49076..6290a77 100755
--- a/regress/cmdline/cleanup.sh
+++ b/regress/cmdline/cleanup.sh
@@ -304,7 +304,9 @@ test_cleanup_missing_pack_file() {
 
 	echo -n "gotadmin: objects/pack/pack-${packhash}.idx: " \
 		> $testroot/stderr.expected
-	echo "pack index has no corresponding pack file" \
+	echo -n "pack index has no corresponding pack file; pack file must " \
+		>> $testroot/stderr.expected
+	echo "be restored or 'gotadmin cleanup -p' must be run" \
 		>> $testroot/stderr.expected
 	cmp -s $testroot/stderr.expected $testroot/stderr
 	ret="$?"