Re: [PATCH 2/2] diff: don't retrieve binary blobs for diffstat
- From
Jeff King <peff@peff.net>
- Date
- Feb 22, 2011, 15:37 UTC
- Message-ID
- <20110222153729.GA27178@sigill.intra.peff.net>
- In-Reply-To
- <7v62sdhsjy.fsf@alter.siamese.dyndns.org>
On Mon, Feb 21, 2011 at 03:33:05PM -0800, Junio C Hamano wrote:
Show 9 quoted lines
> Jeff King <peff@peff.net> writes: > > > We only need the size, which is much cheaper to get, > > especially if it is a big binary file. > > > > Signed-off-by: Jeff King <peff@peff.net> > > --- > > Nice ;-) Do we want a test or two for 1/2 by the way?
Yeah, it's probably a good idea. Can you squash this in, or should I resend?
---
diff --git a/t/t4031-diff-rewrite-binary.sh b/t/t4031-diff-rewrite-binary.sh index 7e7b307..7d7470f 100755 --- a/t/t4031-diff-rewrite-binary.sh +++ b/t/t4031-diff-rewrite-binary.sh @@ -44,6 +44,13 @@ test_expect_success 'rewrite diff can show binary patch' ' grep "GIT binary patch" diff ' +test_expect_success 'rewrite diff --stat shows binary changes' ' + git diff -B --stat --summary >diff && + grep "Bin" diff && + grep "0 insertions.*0 deletions" diff && + grep " rewrite file" diff +' + { echo "#!$SHELL_PATH" cat <<'EOF'