Skip to content

Commit

Permalink
t6050-replace: test that objects are of the same type
Browse files Browse the repository at this point in the history
and that the -f option bypasses the type check

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Christian Couder authored and Junio C Hamano committed Sep 6, 2013
1 parent 160df71 commit 3e625c8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions t/t6050-replace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3e625c8

Please sign in to comment.