aboutsummaryrefslogtreecommitdiff
path: root/t/t6050-replace.sh
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2009-02-02 06:12:53 +0100
committerJunio C Hamano <gitster@pobox.com>2009-05-31 17:03:00 -0700
commitbebdd271ff660d603ad75fef346ad1ff19fca0cb (patch)
treef1a9ca8a8eefbbf5674b69454e1679acc777ba97 /t/t6050-replace.sh
parent54b0c1e041e50cc08b1520b7d557770916d0b7ab (diff)
downloadgit-bebdd271ff660d603ad75fef346ad1ff19fca0cb.tar.gz
git-bebdd271ff660d603ad75fef346ad1ff19fca0cb.tar.xz
builtin-replace: teach "git replace" to actually replace
Teach the syntax: "git replace <object> <replacement>", so that "git replace" can now create replace refs. These replace refs will be used by read_sha1_file to substitute <object> with <replacement> for most of the commands. 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.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
index bf4c93f7f..448a19a5e 100755
--- a/t/t6050-replace.sh
+++ b/t/t6050-replace.sh
@@ -114,9 +114,19 @@ test_expect_success '"git replace" listing and deleting' '
test_must_fail git replace -d &&
test_must_fail git replace -l -d $HASH2 &&
git replace -d $HASH2 &&
+ git show $HASH2 | grep "A U Thor" &&
test -z "$(git replace -l)"
'
+test_expect_success '"git replace" replacing' '
+ git replace $HASH2 $R &&
+ git show $HASH2 | grep "O Thor" &&
+ test_must_fail git replace $HASH2 $R &&
+ git replace -f $HASH2 $R &&
+ test_must_fail git replace -f &&
+ test "$HASH2" = "$(git replace)"
+'
+
#
#
test_done