Verify bytes read matches length of file when generating blob ids
commit68aab760b3bbeb2e4631f8340ff2f2caab6056d7
authorShawn O. Pearce <spearce@spearce.org>
Sun, 30 Mar 2008 01:23:08 +0000 (29 21:23 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 7 Apr 2008 05:06:32 +0000 (7 01:06 -0400)
treef3b7011296354c7dff9cffbb56e3b8e5c524e29a
parenta248c06876e51f098edeb11f7e111b3b9bb6eb7f
Verify bytes read matches length of file when generating blob ids

If a blob file truncates in the middle of us reading it to
compute the name of the file during a tree walk that is using
a FileTreeIterator we should detect this condition and error
out with a zero id rather than compute an incorrect hash.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.spearce.jgit/src/org/spearce/jgit/treewalk/WorkingTreeIterator.java