summaryrefslogtreecommitdiff
path: root/t/t1050-large.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-08-16 03:08:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-08-18 17:16:55 (GMT)
commit1aaf69e669b7fd67073d3024b386ac25ac77d0f8 (patch)
tree35d49af45158e859a9918eac1957965af800f5c7 /t/t1050-large.sh
parent6bf3b813486b4528feca39d599c256f662defc14 (diff)
downloadgit-1aaf69e669b7fd67073d3024b386ac25ac77d0f8.zip
git-1aaf69e669b7fd67073d3024b386ac25ac77d0f8.tar.gz
git-1aaf69e669b7fd67073d3024b386ac25ac77d0f8.tar.bz2
diff: shortcut for diff'ing two binary SHA-1 objects
If we are given two SHA-1 and asked to determine if they are different (but not _what_ differences), we know right away by comparing SHA-1. A side effect of this patch is, because large files are marked binary, diff-tree will not need to unpack them. 'diff-index --cached' will not either. But 'diff-files' still does. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1050-large.sh')
-rwxr-xr-xt/t1050-large.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t1050-large.sh b/t/t1050-large.sh
index 00d2f33..05a1e1d 100755
--- a/t/t1050-large.sh
+++ b/t/t1050-large.sh
@@ -116,6 +116,16 @@ test_expect_success 'diff --stat' '
git diff --stat HEAD^ HEAD
'
+test_expect_success 'diff' '
+ git diff HEAD^ HEAD >actual &&
+ grep "Binary files.*differ" actual
+'
+
+test_expect_success 'diff --cached' '
+ git diff --cached HEAD^ >actual &&
+ grep "Binary files.*differ" actual
+'
+
test_expect_success 'hash-object' '
git hash-object large1
'