summaryrefslogtreecommitdiff
path: root/t/t6050-replace.sh
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2013-12-11 07:46:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-12-12 19:53:49 (GMT)
commit303c5d65c972de2e9d0821647b06ab595c21d355 (patch)
tree68ed99387184bb1df4f34c37e52b68f105c3fc4c /t/t6050-replace.sh
parentde7b5d6218e4b928c5a395e34e5e1de40fae2a0d (diff)
downloadgit-303c5d65c972de2e9d0821647b06ab595c21d355.zip
git-303c5d65c972de2e9d0821647b06ab595c21d355.tar.gz
git-303c5d65c972de2e9d0821647b06ab595c21d355.tar.bz2
t6050: show that git cat-file --batch fails with replace objects
When --batch is passed to git cat-file, the sha1_object_info_extended() function is used to get information about the objects passed to git cat-file. Unfortunately sha1_object_info_extended() doesn't take care of object replacement properly, so it will often fail with a message like this: $ echo a3fb2e1845a1aaf129b7975048973414dc172173 | git cat-file --batch a3fb2e1845a1aaf129b7975048973414dc172173 commit 231 fatal: object a3fb2e1845a1aaf129b7975048973414dc172173 change size!? The goal of this patch is to show this breakage. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6050-replace.sh')
-rwxr-xr-xt/t6050-replace.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
index 7d47984..b90dbdc 100755
--- a/t/t6050-replace.sh
+++ b/t/t6050-replace.sh
@@ -276,6 +276,11 @@ test_expect_success '-f option bypasses the type check' '
git replace -f HEAD^ $BLOB
'
+test_expect_failure 'git cat-file --batch works on replace objects' '
+ git replace | grep $PARA3 &&
+ echo $PARA3 | git cat-file --batch
+'
+
test_expect_success 'replace ref cleanup' '
test -n "$(git replace)" &&
git replace -d $(git replace) &&