CommitGraphWriter: throw exception on unknown chunk
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
This commit is contained in:
parent
2be8bf2b37
commit
13c8dacae5
|
@ -222,6 +222,9 @@ private void writeChunks(ProgressMonitor monitor,
|
||||||
}
|
}
|
||||||
chunk.data.get().writeTo(out);
|
chunk.data.get().writeTo(out);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
throw new IllegalStateException(
|
||||||
|
"Don't know how to write chunk " + chunkId); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue