summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2009-02-02 05:12:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-06-01 00:02:59 (GMT)
commit54b0c1e041e50cc08b1520b7d557770916d0b7ab (patch)
treef1f3d72c24a5210c423e2e8601c3db1bbbb5e956 /t
parentdae556bdb1e2ad6fb5eafe82e975bde01029fca9 (diff)
downloadgit-54b0c1e041e50cc08b1520b7d557770916d0b7ab.zip
git-54b0c1e041e50cc08b1520b7d557770916d0b7ab.tar.gz
git-54b0c1e041e50cc08b1520b7d557770916d0b7ab.tar.bz2
Add new "git replace" command
This command can only be used now to list replace refs in "refs/replace/" and to delete them. The option to list replace refs is "-l". The option to delete replace refs is "-d". The behavior should be consistent with how "git tag" and "git branch" are working. The code has been copied from "builtin-tag.c" by Kristian Høgsberg <krh@redhat.com> and Carlos Rica <jasampler@gmail.com> that was itself based on git-tag.sh and mktag.c by Linus Torvalds. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t6050-replace.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
index 17f6063..bf4c93f 100755
--- a/t/t6050-replace.sh
+++ b/t/t6050-replace.sh
@@ -105,6 +105,18 @@ test_expect_success 'repack, clone and fetch work' '
cd ..
'
+test_expect_success '"git replace" listing and deleting' '
+ test "$HASH2" = "$(git replace -l)" &&
+ test "$HASH2" = "$(git replace)" &&
+ aa=${HASH2%??????????????????????????????????????} &&
+ test "$HASH2" = "$(git replace -l "$aa*")" &&
+ test_must_fail git replace -d $R &&
+ test_must_fail git replace -d &&
+ test_must_fail git replace -l -d $HASH2 &&
+ git replace -d $HASH2 &&
+ test -z "$(git replace -l)"
+'
+
#
#
test_done