summaryrefslogtreecommitdiff
path: root/t/t6050-replace.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-05-15 19:54:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-05-15 22:23:32 (GMT)
commitabb25ac365791e16563dfd09e4ecd3e7e4dcf6b1 (patch)
tree1eb3704391b1a89a93dc1db9f06d125e1ab98b53 /t/t6050-replace.sh
parentfea33a1ef37a5891ebd1fcf6018849150e7b91cb (diff)
downloadgit-abb25ac365791e16563dfd09e4ecd3e7e4dcf6b1.zip
git-abb25ac365791e16563dfd09e4ecd3e7e4dcf6b1.tar.gz
git-abb25ac365791e16563dfd09e4ecd3e7e4dcf6b1.tar.bz2
t6050: make sure we test not just commit replacement
The replacement mechanism should affect all types of objects not just commits, so make sure it deals with at least a blob. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6050-replace.sh')
-rwxr-xr-xt/t6050-replace.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
index ae2194e..5c87f28 100755
--- a/t/t6050-replace.sh
+++ b/t/t6050-replace.sh
@@ -236,6 +236,20 @@ test_expect_success 'index-pack and replacements' '
git index-pack test-*.pack
'
-#
-#
+test_expect_success 'not just commits' '
+ echo replaced >file &&
+ git add file &&
+ REPLACED=$(git rev-parse :file) &&
+ mv file file.replaced &&
+
+ echo original >file &&
+ git add file &&
+ ORIGINAL=$(git rev-parse :file) &&
+ git update-ref refs/replace/$ORIGINAL $REPLACED &&
+ mv file file.original &&
+
+ git checkout file &&
+ test_cmp file.replaced file
+'
+
test_done