From: Christian Couder Date: Fri, 06 Sep 2013 05:10:55 GMT Subject: [PATCH v5 3/7] t6050-replace: test that objects are of the same type Message-ID: <20130906051100.6657.75496.chriscool@tuxfamily.org> In-Reply-To: <20130906050702.6657.25651.chriscool@tuxfamily.org> and that the -f option bypasses the type check Signed-off-by: Christian Couder --- t/t6050-replace.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh index decdc33..09bad98 100755 --- a/t/t6050-replace.sh +++ b/t/t6050-replace.sh @@ -263,4 +263,17 @@ test_expect_success 'not just commits' ' test_cmp file.replaced file ' +test_expect_success 'replaced and replacement objects must be of the same type' ' + test_must_fail git replace mytag $HASH1 && + test_must_fail git replace HEAD^{tree} HEAD~1 && + BLOB=$(git rev-parse :file) && + test_must_fail git replace HEAD^ $BLOB +' + +test_expect_success '-f option bypasses the type check' ' + git replace -f mytag $HASH1 && + git replace -f HEAD^{tree} HEAD~1 && + git replace -f HEAD^ $BLOB +' + test_done -- 1.8.4.rc1.28.ge2684af