CommitGraphWriter first defines the chunks and then writes them. If at
write time a chunk is unknown, it is ignored. This is brittle: if
somebody adds a chunk to the header but not to the actual writing, the
commit-graph is broken and there is no error reported anywhere.
Throw exception if at write time a chunk is unknown. This can only
happen by a coding error in the writer.
Change-Id: Iade677bb6ce368b6941b75a21c622917afa3b751
}
chunk.data.get().writeTo(out);
break;
+ default:
+ throw new IllegalStateException(
+ "Don't know how to write chunk " + chunkId); //$NON-NLS-1$
}
}
}