diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2008-08-02 21:38:56 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-08-02 15:21:59 -0700 |
commit | bc699afcce3c45bb17aaca145d081992ed699a42 (patch) | |
tree | e52a0b9ceb2aca3543bfab40dde0f0a1398fe41e /t/t5601-clone.sh | |
parent | Merge branch 'maint' (diff) | |
download | tgif-bc699afcce3c45bb17aaca145d081992ed699a42.tar.xz |
clone: Add an option to set up a mirror
The command line
$ git clone --mirror $URL
is now a short-hand for
$ git clone --bare $URL
$ (cd $(basename $URL) && git remote add --mirror origin $URL)
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5601-clone.sh')
-rwxr-xr-x | t/t5601-clone.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index d785b3df78..a5334570ad 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -70,4 +70,16 @@ test_expect_success 'clone creates intermediate directories for bare repo' ' ' +test_expect_success 'clone --mirror' ' + + git clone --mirror src mirror && + test -f mirror/HEAD && + test ! -f mirror/file && + FETCH="$(cd mirror && git config remote.origin.fetch)" && + test "+refs/*:refs/*" = "$FETCH" && + MIRROR="$(cd mirror && git config --bool remote.origin.mirror)" && + test "$MIRROR" = true + +' + test_done |