[git] IJPL-158448 Ignore "error: cannot read" when loading of non-existing content

`git cat-file --filters` with prints "error: cannot read object" if the object is missing.
However, `git cat-file -p` fails with "fatal: Not a valid object name" under the same condition.

See 92999a42db/builtin/cat-file.c (L73) and 92999a42db/builtin/cat-file.c (L184)

GitOrigin-RevId: 6131554a65c38f12adba70c72117bc17b3dd01dd
This commit is contained in:
Ilia.Shulgin
2025-01-07 17:07:53 +01:00
committed by intellij-monorepo-bot
parent c6091dd4eb
commit c786682e6c

View File

@@ -250,7 +250,9 @@ public final class GitMergeUtil {
|| (m.startsWith("fatal: Path '") && m.contains("' exists on disk, but not in '"))
|| m.contains("is in the index, but not at stage ")
|| m.contains("bad revision")
|| m.startsWith("fatal: Not a valid object name")) {
|| m.startsWith("fatal: Not a valid object name")
|| m.startsWith("error: cannot read object")) {
LOG.warn("Failed to load revision content for %s (stage %d): '%s'\nAssuming missing side".formatted(path, stageNum, m));
return null; // assume missing side of 'Deleted-Modified', 'Deleted-Deleted', 'Added-Added' conflicts
}
else {