summaryrefslogtreecommitdiff
path: root/mergetools
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2018-10-30 23:23:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-31 04:05:26 (GMT)
commit98f425b453870cdb20b4bf8daa29f52af8e59866 (patch)
treee9ec3be96b91298e849218623f36f56ba7c13c94 /mergetools
parentccdc4819d56202d49e35fbfec2960e221576f862 (diff)
downloadgit-98f425b453870cdb20b4bf8daa29f52af8e59866.zip
git-98f425b453870cdb20b4bf8daa29f52af8e59866.tar.gz
git-98f425b453870cdb20b4bf8daa29f52af8e59866.tar.bz2
cat-file: handle streaming failures consistently
There are three ways to convince cat-file to stream a blob: - cat-file -p $blob - cat-file blob $blob - echo $batch | cat-file --batch In the first two, we simply exit with the error code of streaw_blob_to_fd(). That means that an error will cause us to exit with "-1" (which we try to avoid) without printing any kind of error message (which is confusing to the user). Instead, let's match the third case, which calls die() on an error. Unfortunately we cannot be more specific, as stream_blob_to_fd() does not tell us whether the problem was on reading (e.g., a corrupt object) or on writing (e.g., ENOSPC). That might be an opportunity for future work, but for now we will at least exit with a sane message and exit code. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'mergetools')
0 files changed, 0 insertions, 0 deletions