aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2015-01-13 10:57:12 +0100
committerAlberto Bertogli <albertito@blitiri.com.ar>2015-01-13 20:51:44 +0100
commit58037e57c591b1c55594a0adb637d1880bfacaee (patch)
tree72de02b4ddaefa686fa69e3810124c5d54f3cb13 /views
parent50c004f8a5f26ad27f03597b050f9b1a1910cc45 (diff)
downloadgit-arr-fork-58037e57c591b1c55594a0adb637d1880bfacaee.zip
Repo.blob: respect reported blob size
Batch output of git-cat-file has the form: <sha1> SP <type> SP <size> LF <contents> LF It unconditionally includes a trailing line-feed which Repo.blob() incorrectly returns as part of blob content. For textual blobs, this extra character is often benign, however, for binary blobs, it can easily change the meaning of the data in unexpected or disastrous ways. Fix this by respecting the blob size reported by git-cat-file. (The alternate approach of unconditionally dropping the final LF also works, however, respecting the reported size is perhaps a bit more robust and "correct".) Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
Diffstat (limited to 'views')
0 files changed, 0 insertions, 0 deletions